openapi: 3.0.3
info:
  title: Namirial Onboarding API
  description: >
    Namirial Onboarding API


    **Do you support non-breaking changes?**

    A non-breaking change means that we are able to change some aspects of the
    API and it should not affect your integration.

    For instance, changes at API level listed below should not carry out any
    inconvenience to your integration: 
      - Adding new response fields.
      - Adding new response headers.
      - Adding new endpoints / operations.
      - Adding new optional parameters in the requests.
      - Changing the order of properties in existing API responses.
      - Changing the length or format of strings and string based ids.
  version: 2.0.0
servers:
  - url: https://test-eu-ie1-api.namirialonboarding.com/api/v2
tags:
  - name: Request API
    description: >
      Set of APIs for creating new instances of requests and retrieving their
      details.
  - name: Request Type API
    description: Set of APIs for getting info about request types
  - name: Data Enrichment API
    description: Set of APIs for Data Enrichment
  - name: DataHub API
    description: >
      Set of APIs for managing self-contained DataHub workflows that enable
      identity verification 

      through advanced data intelligence. These APIs allow clients to initiate,
      monitor, and retrieve 

      results from processes involving data analysis, validation, and matching
      against trusted sources 

      as part of digital onboarding and compliance procedures.
paths:
  /requests:
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestsPost
      summary: Create a new request
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
        - name: language
          in: query
          required: false
          schema:
            type: string
        - name: draft
          description: >
            if draft is true then the request is created in a draft status, so
            idempotencyKey is ignored 

            and all the validations will be done when the request will be
            effectively created through the

            requestIdCreation endpoint.

            All the draft requests will be deleted after 7 days unless they are
            actually created
          in: query
          required: false
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
      responses:
        '200':
          description: The created request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestCreateResponse'
        '400':
          $ref: '#/components/responses/400'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestsGet
      summary: Get requests
      description: >
        Sorting Fields: 
          - createdAt
          - updatedAt

        Note: Due to caching mechanism the bulk view may not be in sync with
        single request detail view.
      parameters:
        - $ref: '#/components/parameters/SortQueryParam'
        - $ref: '#/components/parameters/PageQueryParam'
        - $ref: '#/components/parameters/SizeQueryParam'
        - $ref: '#/components/parameters/StatusQueryParam'
        - $ref: '#/components/parameters/ReferenceIdParam'
        - $ref: '#/components/parameters/OperatorPendingQueryParam'
        - $ref: '#/components/parameters/IdQueryParam'
        - $ref: '#/components/parameters/RequestTypeIdQueryParam'
        - $ref: '#/components/parameters/OrganizationIdQueryParam'
        - $ref: '#/components/parameters/FuzzySearchQueryParam'
      responses:
        '200':
          description: The fetched request
          content:
            application/json:
              schema:
                title: RequestsPage
                type: object
                properties:
                  content:
                    type: array
                    items:
                      $ref: '#/components/schemas/RequestsGet'
                  page:
                    $ref: '#/components/schemas/Page'
  /requests/export:
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestsExport
      summary: Generate Requests Export
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestsExportRequest'
      responses:
        '200':
          description: Ok,
          content:
            application/json:
              schema: {}
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
  /request/{id}:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestIdGet
      summary: Get request
      responses:
        '200':
          description: The request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Request'
        '404':
          $ref: '#/components/responses/404'
    put:
      security:
        - bearerAuth: []
      tags:
        - Request API
      operationId: requestIdPut
      parameters:
        - $ref: '#/components/parameters/CreateQueryParam'
      summary: Modify a request in status DRAFT
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRequest'
      responses:
        '200':
          description: The created request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestCreateResponse'
        '400':
          $ref: '#/components/responses/400'
  /request/{id}/creation:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    post:
      security:
        - bearerAuth: []
      tags:
        - Request API
      operationId: requestIdCreationPost
      summary: Publish a request in status DRAFT
      requestBody:
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: The created request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestCreateResponse'
        '400':
          $ref: '#/components/responses/400'
  /request/{id}/links:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    post:
      tags:
        - Request API
      security:
        - ApiKeyAuth: []
      operationId: requestIdLinksPost
      summary: >-
        Generate new links associated to a request. Previous links (if not
        expired) are still usable.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateLinkRequest'
      responses:
        '200':
          description: The created request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestLinks'
        '400':
          $ref: '#/components/responses/400'
  /request/{id}/resources/archive:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    post:
      tags:
        - Request API
      security:
        - bearerAuth: []
      operationId: requestIdResourcesArchivePost
      summary: Retrieves resources from a request as a ZIP archive
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceArchiveRequest'
      responses:
        '200':
          description: ZIP archive
          content:
            application/zip:
              schema:
                $ref: '#/components/schemas/ResourceArchiveResponse'
  /request/{id}/resources/links:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    post:
      tags:
        - Request API
      security:
        - ApiKeyAuth: []
      operationId: requestIdResourcesLinkPost
      summary: Retrieve resources from a request
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceLinkRequest'
      responses:
        '200':
          description: >-
            In case of payload, or in case of inline and zip it will be the
            octet-stream
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RequestResource'
  /requestType/{id}/webhookConfigurations:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request Type API
      operationId: requestTypeIdWebhookConfigurationsGet
      summary: Get request type webhooks configurations
      responses:
        '200':
          description: The webhook configurations for the specified request type
          content:
            application/json:
              example: |
                {
                  "content": [
                    {
                      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "url": "https://your.domain/webhook",
                      "createdAt": "2024-10-22T12:19:12.269594Z"
                    }
                  ]
                }
              schema:
                title: WebhookConfigurationsPage
                type: object
                properties:
                  content:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebhookConfiguration'
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - Request Type API
      operationId: requestTypeIdWebhookConfigurationPost
      summary: Create request type webhooks setting
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookConfiguration'
      responses:
        '200':
          description: The webhook settings created
          content:
            application/json:
              example: |
                {
                  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                  "url": "https://your.domain/webhook",
                  "createdAt": "2024-10-22T12:19:12.269594Z"
                }
              schema:
                $ref: '#/components/schemas/WebhookConfiguration'
        '400':
          $ref: '#/components/responses/400'
  /requestType/{id}/webhookConfiguration/{webhookConfigurationId}:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
      - in: path
        required: true
        name: webhookConfigurationId
        schema:
          type: string
          format: uuid
    delete:
      security:
        - ApiKeyAuth: []
      tags:
        - Request Type API
      operationId: requestTypeIdWebhookConfigurationIdDelete
      summary: Delete the specified webhook setting
      responses:
        '204':
          description: The resource was deleted successfully.
        '400':
          $ref: '#/components/responses/400'
  /requestType/{id}/settings:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request Type API
      operationId: requestTypeIdSettingsGet
      summary: Get default public request type settings
      responses:
        '200':
          description: The Default Request Type Settings
          content:
            application/json:
              schema:
                type: object
                title: RequestTypeSettingsResponse
                properties:
                  requestSettingsDefault:
                    $ref: '#/components/schemas/ObjectNode'
        '404':
          $ref: '#/components/responses/404'
    put:
      security:
        - ApiKeyAuth: []
      tags:
        - Request Type API
      operationId: requestTypeIdSettingsPut
      summary: Add, delete or modify the default public request type settings
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: RequestTypeSettingsRequest
              properties:
                requestSettingsDefault:
                  $ref: '#/components/schemas/ObjectNode'
      responses:
        '200':
          description: The Updated default public request type settings
          content:
            application/json:
              schema:
                type: object
                title: RequestTypeSettingsResponse
                properties:
                  requestSettingsDefault:
                    $ref: '#/components/schemas/ObjectNode'
        '400':
          $ref: '#/components/responses/400'
  /request/{id}/identifications:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestIdIdentifications
      summary: Get request Identifications
      responses:
        '200':
          description: The request identifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestIdentifications'
  /request/{id}/identification:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
      - $ref: '#/components/parameters/IdentificationIdParam'
      - $ref: '#/components/parameters/ActorIdParam'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestIdIdentificationIdGet
      summary: Get request identification detail.
      responses:
        '200':
          description: The request identifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Identification'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
  /request/{id}/signatures:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Signature API
      operationId: requestIdSignatureGet
      summary: Get Signature associated to a request
      parameters:
        - $ref: '#/components/parameters/ActorIdParam'
        - $ref: '#/components/parameters/IncludeUrlValidBeforeQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                title: RequestSignaturePage
                properties:
                  content:
                    type: array
                    items:
                      $ref: '#/components/schemas/SignatureResource'
  /request/{id}/upload:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestIdUploadPost
      summary: Upload resource to a draft request
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                resourceDescription:
                  $ref: '#/components/schemas/AddRequestResource'
      responses:
        '200':
          description: The resource uri, version and etag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResourceResponse'
        '400':
          $ref: '#/components/responses/400'
  /request/{id}/dataEnrichments/simple:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Data Enrichment API
      operationId: requestIdDataEnrichmentsSimpleGet
      summary: Retrieves the request's Data Enrichments with simpler details
      responses:
        '200':
          description: The request's Data Enrichments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnrichmentSimpleResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
  /request/{id}/actor/{actor}/ca22d:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
      - in: path
        required: true
        name: actor
        schema:
          type: string
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - Request API
      operationId: requestIdActorIdCa22dGet
      summary: Retrieves the CA22D module PDFs for the given requestId and actorId
      responses:
        '200':
          description: ZIP containing the requested signed CA22D module PDFs
          content:
            application/zip:
              schema:
                $ref: '#/components/schemas/ResourceArchiveResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
  /dataHub:
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - DataHub API
      operationId: requestDataIntelligencePost
      summary: Initiates a data intelligence workflow for identity verification
      description: >
        Starts a Data Intelligence process to collect and analyze personal data
        for the purpose of verifying a user's identity.  This may involve checks
        against official records, biometric data, and other sources to validate
        the identity in compliance with onboarding and regulatory requirements.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DthPostRequest'
      responses:
        '200':
          description: Request successfully received and the process has been initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DthPostResponse'
  /dataHub/{id}:
    parameters:
      - $ref: '#/components/parameters/UUIDParamPath'
    get:
      security:
        - ApiKeyAuth: []
      tags:
        - DataHub API
      operationId: requestDataIntelligenceGet
      summary: Retrieves the status and results of a data intelligence process
      description: >
        Fetches the current status and results of a previously initiated Data
        Intelligence process identified by the given ID.  The response may
        include data validation outcomes, identity verification results, and
        other relevant insights gathered during the analysis.
      responses:
        '200':
          description: Data intelligence process retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DthGetResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    IdempotencyKey:
      in: query
      required: false
      name: idempotencyKey
      schema:
        type: string
        maxLength: 64
      description: >
        Optional field. If the endpoint already have received a request with the
        same `IdempotencyKey` in the last 7 days

        (+1 day: not strict, depending on operation scheduling) it replies with
        the same body that has been sent the first time. Please note, that
        entity in the body, may have

        been updated in the meantime and those changes will not be present in
        any next replies.

        The idempotency key should not be reused by the Integrator to refer to a
        different request, it is meant to be temporary, specific to reties of a
        single request to avoid duplications.
    IdParamPath:
      in: path
      required: true
      name: id
      schema:
        type: string
    UUIDParamPath:
      in: path
      required: true
      name: id
      schema:
        type: string
        format: uuid
    IncludeUrlValidBeforeQueryParam:
      name: includeUrlValidBefore
      in: query
      schema:
        type: string
        format: date-time
    SortQueryParam:
      in: query
      required: false
      name: sort
      schema:
        type: string
      description: >
        Not all fields are supported in sorting. See the description of the
        endpoint for the list of supported fields.

        Specify the field to sort and the ordering (`asc`, or `desc`) separated
        by a coma.
      example: createdAt,desc
    StatusQueryParam:
      in: query
      required: false
      name: status
      schema:
        type: string
      description: |
        Used to filter requests by their current status.
      example: RUNNING
    ReferenceIdParam:
      in: query
      required: false
      name: referenceId
      schema:
        type: string
      description: |
        Used to filter requests by their referenceId.
      example: order-1234-0002
    OperatorPendingQueryParam:
      in: query
      required: false
      name: operatorPending
      schema:
        type: boolean
      description: |
        Used to filter requests by operatorPending.
    IdQueryParam:
      in: query
      required: false
      name: id
      schema:
        type: string
        format: uuid
      description: |
        Used to filter requests by id.
    RequestTypeIdQueryParam:
      in: query
      required: false
      name: requestTypeId
      schema:
        type: string
        format: uuid
      description: |
        Used to filter requests by requestTypeId.
    OrganizationIdQueryParam:
      in: query
      required: false
      name: organizationId
      schema:
        type: string
        format: uuid
      description: |
        Used to filter requests by organizationId.
    FuzzySearchQueryParam:
      in: query
      required: false
      name: search
      schema:
        type: string
      description: >
        Used to search for requests by identified people's first name, last name
        and / or personal number.
    PageQueryParam:
      in: query
      required: false
      name: page
      schema:
        type: integer
        format: int64
      description: |
        Page numbers starting at 0.
    SizeQueryParam:
      in: query
      required: false
      name: size
      schema:
        type: integer
        format: int64
      description: >
        Size 0 equals to default size. Maximum size may be limited anytime and
        not honored by the backend.
    IdentificationIdParam:
      in: query
      required: false
      name: identificationId
      schema:
        type: string
        format: uuid
      description: If not set, the endpoint returns the last identification.
    ActorIdParam:
      in: query
      required: false
      name: actor
      schema:
        type: string
      description: >
        The id of the actor. According to the endpoint it may be required if
        multiple actors are defined

        for the requestType.
    CreateQueryParam:
      in: query
      required: false
      name: create
      schema:
        type: boolean
  responses:
    '400':
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemBadRequest'
      description: Bad Request described following Problem Details (RFC 9457)
    '404':
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      description: Not Found described following Problem Details (RFC 9457)
    '429':
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      description: Too Many Requests described following Problem Details (RFC 9457)
  schemas:
    ProblemBadRequest:
      allOf:
        - $ref: '#/components/schemas/ProblemDetail'
      type: object
      properties:
        errors:
          type: array
          description: An array of error details to accompany a problem details response.
          maxItems: 1000
          items:
            type: object
            description: >-
              An object to provide explicit details on a problem towards an API
              consumer.
            properties:
              detail:
                type: string
                description: >-
                  A human-readable explanation specific to this occurrence of
                  the problem.
                example: >-
                  Property 'dummyField' is not defined in the schema and the
                  schema does not allow additional properties.
              pointer:
                type: string
                description: >-
                  A JSON Pointer to a specific request body property that is the
                  source of error.
                example: /parameters/dummyField
              field:
                type: string
                description: The name of the field that is the source of error.
                example: dummyField
              reason:
                type: string
                description: >-
                  A machine oriented error type. Eg. additionalProperties,
                  required
                example: additionalProperties
            required:
              - detail
    ProblemDetail:
      type: object
      properties:
        type:
          type: string
          description: A URI reference that identifies the problem type.
          format: uri
          maxLength: 1024
          example: about:blank
          default: about:blank
        status:
          type: integer
          description: >-
            The HTTP status code generated by the origin server for this
            occurrence of the problem.
          format: int32
          minimum: 100
          maximum: 599
          example: 400
        title:
          type: string
          description: >-
            A short, human-readable summary of the problem type. It should not
            change from occurrence to occurrence of the problem, except for
            purposes of localization.
          maxLength: 1024
          example: Request validation error
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          maxLength: 4096
          example: The has a malformed body property.
        instance:
          type: string
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. It may or may not yield further information if
            dereferenced.
          maxLength: 1024
          example: urn:uuid:123e4567-e89b-12d3-a456-426614174000?ts=1729667463
        retryable:
          type: boolean
          description: If the api call can be retried
          example: false
      required:
        - status
    RequestError:
      type: object
      properties:
        id:
          type: string
          format: uuid
        at:
          type: string
          format: date-time
        message:
          type: string
        status:
          type: integer
          format: int32
        retryable:
          type: boolean
    BadRequestError:
      allOf:
        - $ref: '#/components/schemas/RequestError'
      properties:
        errors:
          type: array
          items:
            additionalProperties:
              type: object
    Page:
      type: object
      properties:
        size:
          type: integer
          format: int64
          description: >-
            the size of the pages. The last page can have less items, do not use
            as item counter the reply.
          example: 1
        number:
          type: integer
          format: int64
          description: zero-based page number, is not negative.
          example: 0
        totalElements:
          type: integer
          format: int64
          description: counter of elements matching the query.
          example: 4
        totalPages:
          type: integer
          format: int64
          description: counter of pages of the current size.
          example: 4
    Request:
      type: object
      description: >
        - `createdAt`:  The instant of request creation.

        - `updatedAt`:  Last update instant. 

        - `finalizedAt`: The instant when the request reached a terminal status.

        - `expireAfter`:  The instant after which the request cannot be
        processed anymore, because it has not been completed on time.

        - `anonymizedAt`: The instant of request anonymization.
      required:
        - requestTypeId
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organizationId:
          type: string
          format: uuid
          readOnly: true
        status:
          $ref: '#/components/schemas/RequestStatus'
        referenceId:
          $ref: '#/components/schemas/ReferenceId'
        requestTypeId:
          $ref: '#/components/schemas/RequestTypeId'
        parameters:
          $ref: '#/components/schemas/ObjectNode'
        settings:
          $ref: '#/components/schemas/ObjectNode'
        createdAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        updatedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        finalizedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        expireAfter:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        anonymizedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        operatorPending:
          type: boolean
        terminationReason:
          $ref: '#/components/schemas/TerminationReason'
        customerAttributes:
          description: >
            Lightweight store for additional string attributes for the
            Integrator. 

            It may be limited in size (it is not intended to store files or
            large objects).
          $ref: '#/components/schemas/ObjectNode'
    UpdateRequest:
      type: object
      description: >
        - `createdAt`:  The instant of request creation.

        - `updatedAt`:  Last update instant. 

        - `finalizedAt`: The instant when the request reached a terminal status.

        - `expireAfter`:  The instant after which the request cannot be
        processed anymore, because it has not been completed on time.
      properties:
        referenceId:
          $ref: '#/components/schemas/ReferenceId'
        parameters:
          $ref: '#/components/schemas/ObjectNode'
        settings:
          $ref: '#/components/schemas/ObjectNode'
        customerAttributes:
          description: >
            Lightweight store for additional string attributes for the
            Integrator. 

            It may be limited in size (it is not intended to store files or
            large objects).
          $ref: '#/components/schemas/ObjectNode'
    RequestCreateResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/Request'
        - $ref: '#/components/schemas/RequestLinks'
    RequestLinks:
      type: object
      properties:
        links:
          type: array
          items:
            title: RequestLink
            type: object
            properties:
              actor:
                $ref: '#/components/schemas/ActorId'
              link:
                type: string
                format: url
                example: https://onboarding.example/res/3949?ts=49943
              expiresAfter:
                $ref: '#/components/schemas/InstantDateTimeReadOnly'
    GenerateLinkRequest:
      type: object
      properties:
        onlyForActors:
          description: >
            If not empty, it limits the generation only for the listed actors.
            Otherwise, it generates for all actors.
          type: array
          items:
            $ref: '#/components/schemas/ActorId'
    RequestsGet:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organizationId:
          type: string
          format: uuid
          readOnly: true
        status:
          $ref: '#/components/schemas/RequestStatus'
        referenceId:
          $ref: '#/components/schemas/ReferenceId'
        requestTypeId:
          $ref: '#/components/schemas/RequestTypeId'
        createdAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        updatedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        finalizedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        anonymizedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        personData:
          type: array
          items:
            $ref: '#/components/schemas/SimplePersonIdentification'
    SimplePersonIdentification:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        personalNumber:
          type: string
          description: |
            Personal identification number used in the country.
            For instance, in Italy is "Codice Fiscale".
          example: DNTCRL65S67M126L
    RequestTypeId:
      type: string
      format: uuid
      description: >
        Identifier of the type of process associated to the request. This
        identifier is given to the Integrator

        during initial setup of the integration project.
    ReferenceId:
      type: string
      example: order-1234-0002
      description: >
        Optional field. It maps an id that is relevant for the Integrator. The
        filed is not used internally.

        More requests can have the same value.
    RequestStatus:
      type: string
      readOnly: true
      description: >
        - `DRAFT`: The request has not been created yet, but it can be modified

        - `CREATED`: The request has been created, but its processing has to
        start yet.

        - `RUNNING`: The request is being processed, it means that actions from
        users or systems still have to be completed.

        - `COMPLETED`: Final status for a request completed successfully
        (according to specific request type 
                       it may have warnings or unsuccessful scenarios accepted by operational behavior).
        - `EXPIRED`: Final status for a request that has not been completed
        before the expiration time.

        - `FAILED`: Final status for a request whose processing has failed.

        - `CANCELLED`: Final status for a request that has been cancelled or
        completed unsuccessfully.

        - `USER_CANCELLED`: DEPRECATED - Final status for a request that a user
        has explicitly cancelled (not applicable to all request types).

        - `OPERATOR_CANCELLED`:  DEPRECATED - Final status for a request that an
        operator has explicitly cancelled (not applicable to all request types).

        - `DRAFT_EXPIRED`:  DEPRECATED - Final status for a request in draft
        status that has not been published before the expiration time
      enum:
        - DRAFT
        - CREATED
        - RUNNING
        - COMPLETED
        - EXPIRED
        - FAILED
        - CANCELLED
    InstantDateTime:
      example: '2024-10-22T12:19:12.269594Z'
      type: object
      properties:
        dummy:
          type: string
    InstantDateTimeReadOnly:
      example: '2024-10-22T12:19:12.269594Z'
      readOnly: true
      type: object
      properties:
        dummySeeComment:
          type: string
    DownloadContentDisposition:
      type: string
      example: INLINE
      description: |
        Values may be added overtime.
        List of values: 
        - "INLINE"
        - "ATTACHMENT"
    RequestResource:
      type: object
      properties:
        id:
          type: string
          format: uuid
        filename:
          example: audit_log.pdf
          type: string
        mimeType:
          type: string
        name:
          example: Audit Log
          type: string
        type:
          $ref: '#/components/schemas/ResourceType'
        family:
          $ref: '#/components/schemas/ResourceFamily'
        subType:
          $ref: '#/components/schemas/ResourceSubType'
        metadata:
          $ref: '#/components/schemas/ObjectNode'
        resourceUrl:
          type: string
          format: uri
          example: https://storage.onboarding.example/res/121323?ts=12386ddd
        urlValidBefore:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        status:
          type: string
          example: AVAILABLE
          description: |
            Values may be added overtime.
            List of values: 
            - AVAILABLE -> Can be downloaded
            - IN_TRANSFER -> The resource is still incomplete
            - ABORTED -> The resource was not completed
            - DELETED -> The resource was deleted
        resourceVersionId:
          type: string
        sizeBytes:
          type: integer
          format: int64
        checksum:
          type: string
    ResourceFamily:
      type: string
      example: IDENTIFICATION_ASSET
      description: |
        Values may be added overtime.
        List of values: 
        - 'IDENTIFICATION_ASSET'
        - 'SIGNED_DOCUMENT'
        - 'ATTACHMENT'
        - 'PROOF'
        - 'DOCUMENT_TO_SIGN'
    ResourceType:
      type: string
      example: BIOMETRY_VIDEO
      description: |
        Values may be added overtime.
        List of values: 
          - 'BIOMETRY_VIDEO'
          - 'BIOMETRY_IMAGE'
          - 'DOCUMENT_VIDEO'
          - 'DOCUMENT_IMAGE'
          - 'CONTRACT_DOCUMENT'
          - 'DOCUMENT'
          - 'IDENTITY_DOCUMENT'
          - 'SIGN_AUDIT_LOG'
          - 'IDP_ASSERTION'
          - 'AUDIT_TRAIL'
    ResourceSubType:
      type: string
      example: FRONT_SIDE
      description: |
        Values may be added overtime.
        List of values: 
        - 'BEST_SELFIE'
        - 'PROCESSED_FRONT_SIDE'
        - 'PROCESSED_BACK_SIDE'
        - 'SELFIE'
        - 'FRONT_SIDE'
        - 'BACK_SIDE'
        - 'ID_PHOTO'
        - 'PROOF_RAW'
        - 'PROOF_RENDERED'
        - 'DOCUMENT_FILLED'
        - 'DOCUMENT_FLATTENED'
        - 'APPLICATION_FORM'
    ObjectNode:
      type: object
      properties:
        additionalProp0:
          type: string
      additionalProperties:
        type: object
    RequestNotificationAuthentication:
      type: object
      properties:
        headers:
          type: object
          additionalProperties:
            type: string
        client_key:
          type: string
          description: PEM format client key (not visible in get)
          example: |
            -----BEGIN RSA PRIVATE KEY-----
            MIIH/TCCBeWgAwIBAgIQaBYE3/M08XHYCnNVmcFBcjANBgkqhkiG9w0BAQsFADBy
            MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x
            ETAPBgNVBAoMCFNTTCBDb3JwMS4wLAYDVQQDDCVTU0wuY29tIEVWIFNTTCBJbnRl
            cm1lZGlhdGUgQ0EgUlNBIFIzMB4XDTIwMDQwMTAwNTgzM1oXDTIxMDcxNjAwNTgz
            M1owgb0xCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91
            c3RvbjERMA8GA1UECgwIU1NMIENvcnAxFjAUBgNVBAUTDU5WMjAwODE2MTQyNDMx
            FDASBgNVBAMMC3d3dy5zc2wuY29tMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXph
            dGlvbjEXMBUGCysGAQQBgjc8AgECDAZOZXZhZGExEzARBgsrBgEEAYI3PAIBAxMC
            -----END RSA PRIVATE KEY-----
        client_cert:
          type: string
          description: PEM format certificate
          example: |
            -----BEGIN CERTIFICATE-----
            MIIH/TCCBeWgAwIBAgIQaBYE3/M08XHYCnNVmcFBcjANBgkqhkiG9w0BAQsFADBy
            MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x
            ETAPBgNVBAoMCFNTTCBDb3JwMS4wLAYDVQQDDCVTU0wuY29tIEVWIFNTTCBJbnRl
            cm1lZGlhdGUgQ0EgUlNBIFIzMB4XDTIwMDQwMTAwNTgzM1oXDTIxMDcxNjAwNTgz
            M1owgb0xCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91
            c3RvbjERMA8GA1UECgwIU1NMIENvcnAxFjAUBgNVBAUTDU5WMjAwODE2MTQyNDMx
            FDASBgNVBAMMC3d3dy5zc2wuY29tMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXph
            dGlvbjEXMBUGCysGAQQBgjc8AgECDAZOZXZhZGExEzARBgsrBgEEAYI3PAIBAxMC
            -----END CERTIFICATE-----
    RequestNotification:
      type: object
      properties:
        id:
          description: Id of the notification
          type: string
          format: uuid
        type:
          description: |
            The type of updated that caused the notification.
            Values may be added overtime.
            List of values: 
              - STATUS_UPDATE
          type: string
          example: STATUS_UPDATE
        createdAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        request:
          type: object
          title: RequestNotificationBody
          properties:
            requestId:
              type: string
              format: uuid
            requestTypeId:
              $ref: '#/components/schemas/RequestTypeId'
            status:
              $ref: '#/components/schemas/RequestStatus'
    WebhookConfiguration:
      type: object
      required:
        - url
      properties:
        id:
          description: Id of the webhook configuration
          type: string
          format: uuid
          readOnly: true
        authentication:
          $ref: '#/components/schemas/RequestNotificationAuthentication'
        url:
          type: string
          format: url
          example: https://your.domain/webhook
        createdAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        topics:
          type: array
          items:
            type: string
            enum:
              - REQUEST_STATUS
              - REQUEST_LIFECYCLE
    RequestIdentifications:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        identifications:
          type: array
          items:
            $ref: '#/components/schemas/IdentificationSummary'
    IdentificationSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        actor:
          $ref: '#/components/schemas/ActorId'
        stepId:
          type: string
        status:
          type: string
          example: COMPLETED
          description: |
            The status of the identification. Values may be added overtime.
            Values:
              - PENDING
              - WAITING_FOR_APPROVAL
              - COMPLETED
              - REJECTED
              - FAILED
        source:
          type: string
          example: ID-SELF
          description: >
            The source of identification for the actor.

            It may affect the presence of fields and details that are present in
            this Identification entity.

            Values may be added overtime.

            Values:
              - 'SPID'
              - 'ID-SELF'
        finalizedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
    IdentificationValidationDetailElement:
      type: object
      description: >
        - requestMatched: If this element matches the corresponding parameter
        passed in the create request.

        - otpValidated: If the element has been verified using an otp (eg. by
        email or sms).

        - byIdentificationSource: If the element has been derived from the
        identification source.
      properties:
        requestMatched:
          $ref: '#/components/schemas/IdentificationValidationDetailResult'
        otpValidated:
          $ref: '#/components/schemas/IdentificationValidationDetailResult'
        byIdentificationSource:
          $ref: '#/components/schemas/IdentificationValidationDetailResult'
        byRequestInput:
          $ref: '#/components/schemas/IdentificationValidationDetailResult'
    IdentificationValidationDetailResult:
      type: string
      example: OK
      description: |
        The entry may be missing or null. Values may be added overtime.
        Values:
        - OK: The value has been matched or extracted.
        - NOT_OK: The value has not been matched or extracted.
        - SKIPPED: The value check has not been performed.
    IdentificationValidationDetail:
      type: object
      properties:
        personalNumber:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        lastName:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        firstName:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        birthDate:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        gender:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        phoneNumber:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        email:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
        documentNumber:
          $ref: '#/components/schemas/IdentificationValidationDetailElement'
    SignatureResource:
      type: object
      properties:
        id:
          type: string
          format: uuid
        signedAt:
          type: string
          format: date-time
        method:
          type: string
        pageMode:
          type: string
        signatureType:
          type: string
        plainResource:
          $ref: '#/components/schemas/RequestResource'
        signedResource:
          $ref: '#/components/schemas/RequestResource'
        status:
          type: string
          example: COMPLETED
          description: |
            Values may be added overtime.
            List of values: 
            - 'COMPLETED'
            - 'REJECTED'
            - 'FAILED'
        actorId:
          $ref: '#/components/schemas/ActorId'
    Identification:
      allOf:
        - $ref: '#/components/schemas/IdentificationSummary'
      type: object
      title: IdentificationDetail
      properties:
        organizationId:
          type: string
          format: uuid
        personData:
          $ref: '#/components/schemas/PersonIdentification'
        validationDetail:
          $ref: '#/components/schemas/IdentificationValidationDetail'
        operator:
          $ref: '#/components/schemas/OperatorCheckIdentification'
        idSelf:
          $ref: '#/components/schemas/FacematchIdentification'
        spid:
          $ref: '#/components/schemas/SpidIdentification'
        cie:
          $ref: '#/components/schemas/CieIdentification'
        germanId:
          $ref: '#/components/schemas/GermanIdentification'
        swissId:
          $ref: '#/components/schemas/SwissIdentification'
        austriaId:
          $ref: '#/components/schemas/AustrianIdentification'
        itWallet:
          $ref: '#/components/schemas/ItWallet'
        facephi:
          $ref: '#/components/schemas/FacephiIdentification'
        verifeye:
          $ref: '#/components/schemas/VerifeyeIdentification'
        nfc:
          $ref: '#/components/schemas/NfcIdentification'
    OperatorCheckIdentification:
      type: object
      properties:
        idSelf:
          $ref: '#/components/schemas/LiveCheckIdentification'
        idSelfStartedAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        internalOperator:
          $ref: '#/components/schemas/InternalOperatorPersonIdentification'
    LiveCheckIdentification:
      type: object
      properties:
        receivedAt:
          $ref: '#/components/schemas/InstantDateTime'
        response:
          $ref: '#/components/schemas/FacematchIdentificationDocumentCheck'
        personDataSnapshotBeforeOperatorCheck:
          $ref: '#/components/schemas/PersonIdentification'
        dataChanged:
          type: array
          items:
            $ref: '#/components/schemas/LiveCheckDataChanged'
        operatorCheckResponse:
          $ref: '#/components/schemas/OperatorCheckResponse'
    LiveCheckDataChanged:
      type: object
      properties:
        key:
          type: string
        oldValue:
          type: string
        newValue:
          type: string
    InternalOperatorDataChanged:
      type: object
      properties:
        key:
          type: string
        oldValue:
          type: string
        newValue:
          type: string
    OperatorCheckResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/OperatorCheckResponseStatus'
        message:
          type: string
        areElementsReadable:
          type: boolean
        liveCheckAnalysisUuid:
          type: string
          format: uuid
        refuseReasonEnum:
          type: string
    OperatorCheckResponseStatus:
      type: string
      enum:
        - SUCCESS
        - FAILED
    ItWallet:
      type: object
      properties:
        familyName:
          type: string
        givenName:
          type: string
        birthDate:
          type: string
          format: date
        taxIdCode:
          type: string
        idpAssertion:
          $ref: '#/components/schemas/RequestResource'
    GermanIdentification:
      type: object
      properties:
        eidDocumentNumber:
          type: string
        birthDate:
          type: string
          format: date
        lastName:
          type: string
        firstName:
          type: string
        issuingCountry:
          type: string
        documentType:
          type: string
        birthPlace:
          type: string
        idpAssertion:
          $ref: '#/components/schemas/RequestResource'
    SwissIdentification:
      type: object
      properties:
        lastName:
          type: string
        phoneNumber:
          type: string
        firstName:
          type: string
        email:
          type: string
        idpAssertion:
          $ref: '#/components/schemas/RequestResource'
    AustrianIdentification:
      type: object
      properties:
        lastName:
          type: string
        firstName:
          type: string
        email:
          type: string
        phoneNumber:
          type: string
        idpAssertion:
          $ref: '#/components/schemas/RequestResource'
    SpidIdentification:
      properties:
        samlAssertion:
          $ref: '#/components/schemas/RequestResource'
        spidCode:
          type: string
          example: 123913921923
        fiscalNumber:
          type: string
          example: INIT-DNTCRL65S67M126L
        name:
          type: string
        familyName:
          type: string
        placeOfBirth:
          $ref: '#/components/schemas/BelfioreCode'
        dateOfBirth:
          type: string
          format: date
        gender:
          $ref: '#/components/schemas/Gender'
        expirationDate:
          type: string
          format: date
          description: Present only in SPID Full.
        countryOfBirth:
          type: string
          example: NA
          description: Present only in SPID Full.
        email:
          type: string
          description: Present only in SPID Full.
        mobilePhone:
          type: string
          description: Present only in SPID Full.
        address:
          type: string
          example: Via dei viali 8 00188 Napoli NA
          description: Present only in SPID Full.
        digitalAddress:
          type: string
          description: Present only in SPID Full.
        idCard:
          type: string
          description: |
            Present only in SPID Full.
          example: cartaIdentita ca972111al comuneNapoli 2007-11-19 2018-06-28
        companyName:
          type: string
          description: |
            Present only in SPID Type 3
        registeredOffice:
          type: string
          description: |
            Present only in SPID Type 3
        ivaCode:
          type: string
          description: |
            Present only in SPID Type 3
    CieIdentification:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        birthDate:
          type: string
          format: date
        fiscalNumber:
          type: string
        idpAssertion:
          $ref: '#/components/schemas/RequestResource'
    FacematchIdentification:
      type: object
      properties:
        id:
          type: string
        receivedAt:
          $ref: '#/components/schemas/InstantDateTime'
        artifacts:
          title: FacematchIdentificationArtifacts
          description: >
            Artifacts derived from the identification process. Eg. Video of the
            document, front page of the document, etc.
          type: object
          properties:
            biometry:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
            document:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
        biometryCheck:
          $ref: '#/components/schemas/FacematchIdentificationBiometryCheck'
        documentCheck:
          $ref: '#/components/schemas/FacematchIdentificationDocumentCheck'
    FacephiIdentification:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        birthDate:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        personalNumber:
          type: string
        gender:
          $ref: '#/components/schemas/Gender'
        documentNumber:
          type: string
        documentType:
          type: string
        issuedOn:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        expiryDate:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        placeOfIssue:
          type: string
        issuingCountry:
          type: string
        birthPlace:
          type: string
        address:
          type: string
        artifacts:
          title: FacephiIdentificationArtifacts
          description: >
            Artifacts derived from the identification process. Eg. Back page of
            the document, front page of the document, etc.
          type: object
          properties:
            biometry:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
            document:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
            idpAssertion:
              $ref: '#/components/schemas/RequestResource'
    VerifeyeIdentification:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        birthDate:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        gender:
          $ref: '#/components/schemas/Gender'
        documentNumber:
          type: string
        documentType:
          $ref: '#/components/schemas/IDHubDocumentType'
        issuedOn:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        expiryDate:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
        issuedBy:
          type: string
        issuingCountry:
          type: string
        birthPlace:
          type: string
        address:
          type: string
        phoneNumber:
          type: string
        artifacts:
          title: VerifeyeIdentificationArtifacts
          description: >
            Artifacts derived from the identification process. Eg. Back page of
            the document, front page of the document, etc.
          type: object
          properties:
            biometry:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
            document:
              type: array
              items:
                $ref: '#/components/schemas/RequestResource'
            idpAssertion:
              $ref: '#/components/schemas/RequestResource'
    NfcIdentification:
      type: object
      properties:
        biometryCheck:
          $ref: '#/components/schemas/FacematchIdentification'
        documentCheck:
          $ref: '#/components/schemas/FacematchIdentification'
        documentIdentification:
          $ref: '#/components/schemas/PersonIdentification'
        nfc:
          $ref: '#/components/schemas/NfcData'
        evidence:
          $ref: '#/components/schemas/RequestResource'
    NfcData:
      type: object
      properties:
        transactionId:
          type: string
        readAt:
          $ref: '#/components/schemas/InstantDateTimeReadOnly'
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        birthDate:
          type: string
          format: date
        birthPlace:
          type: string
          example: FIRENZE
        personalNumber:
          type: string
          description: |
            Personal identification number used in the country.
            For instance, in Italy is "Codice Fiscale".
          example: DNTCRL65S67M126L
        gender:
          $ref: '#/components/schemas/Gender'
        nationality:
          $ref: '#/components/schemas/IsoCountryCode'
        phoneNumber:
          type: string
          example: '+393331112233'
        address:
          type: string
        email:
          type: string
          example: jjdoe@example.com
        issuanceCountry:
          $ref: '#/components/schemas/IsoCountryCode'
        issuanceAuthority:
          type: string
          description: |
            Body who issued the document.
          example: Grand Ministry of Documents
        documentType:
          $ref: '#/components/schemas/DocumentType'
        documentNumber:
          type: string
          example: CA19498568Y
        issuedOn:
          type: string
          format: date
        expiryDate:
          type: string
          format: date
        mrz:
          type: array
          items:
            type: string
        authentications:
          type: array
          items:
            type: string
        ocrFallback:
          type: array
          items:
            type: string
        signature:
          type: string
    IDHubDocumentType:
      type: string
      enum:
        - NATIONAL_IDENTITY_CARD
        - PASSPORT
        - DRIVING_LICENSE
        - RESIDENCE_PERMIT
    FacematchIdentificationBiometryCheck:
      type: object
      properties:
        controlsSummary:
          $ref: '#/components/schemas/FacematchControlsSummary'
        controlsGroup:
          $ref: '#/components/schemas/FacematchControlsGroup'
        keysWithError:
          $ref: '#/components/schemas/FacematchKeysWithError'
    FacematchIdentificationDocumentCheck:
      title: FacematchIdentificationDocumentCheck
      type: object
      properties:
        documentType:
          $ref: '#/components/schemas/DocumentType'
        documentTypeFamily:
          $ref: '#/components/schemas/DocumentTypeFamily'
        controlsSummary:
          $ref: '#/components/schemas/FacematchControlsSummary'
        keysWithError:
          $ref: '#/components/schemas/FacematchKeysWithError'
    FacematchControlsGroup:
      type: object
      properties:
        biometryVideoNotTampered:
          $ref: '#/components/schemas/FacematchResultValue'
        idPhotoMatch:
          $ref: '#/components/schemas/FacematchResultValue'
        passiveLiveness:
          $ref: '#/components/schemas/FacematchResultValue'
    FacematchResultValue:
      type: string
      enum:
        - SUCCESS
        - ERROR
        - FAILURE
        - SKIPPED
    FacematchKeysWithError:
      description: list of controls keys paths with status KO or FAILED.
      example:
        - holder.documentConsistency.firstNameFound
      type: array
      items:
        type: string
    FacematchControlsSummary:
      type: integer
      example: -1
      description: |
        0: all controls are fine.
        -1: at least one quality error
        -2: at least one document conformity error
        -3: at least one document consistency or authenticity error
    PersonIdentification:
      type: object
      properties:
        lastName:
          type: string
          example: Doe
        firstName:
          type: string
          example: John
        birthDate:
          type: string
          format: date
        birthPlace:
          type: string
          example: FIRENZE
        personalNumber:
          type: string
          description: |
            Personal identification number used in the country.
            For instance, in Italy is "Codice Fiscale".
          example: DNTCRL65S67M126L
        gender:
          $ref: '#/components/schemas/Gender'
        nationality:
          $ref: '#/components/schemas/IsoCountryCode'
        phoneNumber:
          type: string
          example: '+393331112233'
        address:
          $ref: '#/components/schemas/Address'
        email:
          type: string
          example: jjdoe@example.com
        documentDetails:
          $ref: '#/components/schemas/PersonIdentificationDocument'
    Address:
      type: object
      properties:
        address:
          type: string
          description: It may or may not contain the address number.
          example: Via del Mondo 9
        city:
          type: string
          example: Firenze
        country:
          $ref: '#/components/schemas/IsoCountryCode'
        zipcode:
          type: string
          example: 80123-SOUTH
        province:
          type: string
          description: Optional
          example: FI
        streetNumber:
          type: string
          example: 3bis
          description: >
            The street number, if available by the identification source

            (it may be present or missing in the address. It may be null
            regardless being present in the address).
    PersonIdentificationDocument:
      type: object
      properties:
        issuanceCountry:
          $ref: '#/components/schemas/IsoCountryCode'
        issuanceAuthority:
          type: string
          description: |
            Body who issued the document.
          example: Grand Ministry of Documents
        type:
          $ref: '#/components/schemas/DocumentType'
        number:
          type: string
          example: CA19498568Y
        issuedOn:
          type: string
          format: date
        expiryDate:
          type: string
          format: date
        mrz:
          type: array
          items:
            type: string
    ReviewPersonIdentification:
      type: object
      properties:
        firstName:
          $ref: '#/components/schemas/SimpleReviewValue'
        lastName:
          $ref: '#/components/schemas/SimpleReviewValue'
        birthDate:
          $ref: '#/components/schemas/DateReviewValue'
        birthPlace:
          $ref: '#/components/schemas/SimpleReviewValue'
        personalNumber:
          $ref: '#/components/schemas/SimpleReviewValue'
        gender:
          $ref: '#/components/schemas/GenderReviewValue'
        nationality:
          $ref: '#/components/schemas/SimpleReviewValue'
        phoneNumber:
          $ref: '#/components/schemas/SimpleReviewValue'
        address:
          $ref: '#/components/schemas/AddressReviewValue'
        email:
          $ref: '#/components/schemas/SimpleReviewValue'
        reviewDocumentDetails:
          $ref: '#/components/schemas/ReviewPersonIdentificationDocument'
        dataChanged:
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/InternalOperatorDataChanged'
    ReviewPersonIdentificationDocument:
      type: object
      properties:
        issuanceCountry:
          $ref: '#/components/schemas/IssuanceCountryReviewValue'
        issuanceAuthority:
          $ref: '#/components/schemas/SimpleReviewValue'
        type:
          $ref: '#/components/schemas/DocumentTypeReviewValue'
        number:
          $ref: '#/components/schemas/SimpleReviewValue'
        issuedOn:
          $ref: '#/components/schemas/DateReviewValue'
        expiryDate:
          $ref: '#/components/schemas/DateReviewValue'
        dataChanged:
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/InternalOperatorDataChanged'
    SimpleReviewValue:
      type: object
      properties:
        value:
          type: string
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    DateReviewValue:
      type: object
      properties:
        value:
          type: string
          format: date
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    GenderReviewValue:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/Gender'
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    AddressReviewValue:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/Address'
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    IssuanceCountryReviewValue:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/IsoCountryCode'
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    DocumentTypeReviewValue:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/DocumentType'
        status:
          $ref: '#/components/schemas/OperatorReviewStatus'
        operatorConfiguration:
          $ref: '#/components/schemas/OperatorConfiguration'
    InternalOperatorPersonIdentification:
      type: object
      properties:
        reviewPersonData:
          $ref: '#/components/schemas/ReviewPersonIdentification'
        status:
          $ref: '#/components/schemas/InternalOperatorStepStatus'
        personDataSnapshotBeforeOperatorCheck:
          $ref: '#/components/schemas/PersonIdentification'
        reviewedAt:
          $ref: '#/components/schemas/InstantDateTime'
        rejected:
          type: boolean
          description: >
            this field is true if at least one field has been rejected by
            operator
    IsoCountryCode:
      type: string
      description: >
        Country codes format follows the standard ISO 3166-1 alpha-2 with
        additional values for special cases according to ICAO 9303.
      example: IT
    IsoCountryCode3:
      type: string
      description: >
        Country codes format follows the standard ISO 3166-1 alpha-3 with
        additional values for special cases according to ICAO 9303.
      example: ITA
    BelfioreCode:
      type: string
    DocumentType:
      type: string
      example: Passport
      description: |
        Values may be added overtime.
        List of values: 
        - 'IdentityCard'
        - 'DriverLicense'
        - 'Passport'
        - 'ResidencePermit'
        - 'ItalianTS'
        - 'Undefined'
    DocumentTypeFamily:
      type: string
      example: IDENTITY_DOCUMENT
      description: |
        Values may be added overtime.
        List of values: 
        - 'IDENTITY_DOCUMENT'
        - 'UNDEFINED'
    Gender:
      type: string
      enum:
        - M
        - F
        - X
    ActorId:
      type: string
      example: customer
    AddRequestResource:
      type: object
      properties:
        filename:
          type: string
        mimeType:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/ResourceType'
        subType:
          $ref: '#/components/schemas/ResourceSubType'
        family:
          $ref: '#/components/schemas/ResourceFamily'
        urlValidBefore:
          $ref: '#/components/schemas/InstantDateTime'
        metadata:
          $ref: '#/components/schemas/ObjectNode'
        sha256:
          type: string
    UploadResourceResponse:
      type: object
      properties:
        etag:
          type: string
        version:
          type: string
        resourceUri:
          type: string
          format: uri
    DataEnrichmentComponentType:
      type: string
      enum:
        - DATE
        - EMAIL
        - EMAIL_OTP
        - FILE
        - IT_LOCALITY
        - PASSWORD
        - PHONE
        - PHONE_OTP
        - SELECT
        - TEXT
    DataEnrichmentComponentValue:
      type: object
      description: >
        https://swagger.io/docs/specification/v3_0/data-models/inheritance-and-polymorphism/#discriminator

        The discriminator is used with anyOf or oneOf keywords only.

        It is important that all the models mentioned below anyOf or oneOf
        contain the property that the discriminator specifies.

        https://swagger.io/docs/specification/v3_0/data-models/inheritance-and-polymorphism/#mapping-type-names

        It is implied, that the property to which discriminator refers, contains
        the name of the target schema.

        If the property values do not match the schema names, you can map the
        values to the names. To do this, use the discriminator/mapping keyword.
      oneOf:
        - $ref: '#/components/schemas/DataEnrichmentDateComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentEmailComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentEmailOtpComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentFileComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentITLocalityComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentPhoneComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentPhoneOtpComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentSelectComponentValue'
        - $ref: '#/components/schemas/DataEnrichmentTextComponentValue'
      discriminator:
        propertyName: type
        mapping:
          DATE: '#/components/schemas/DataEnrichmentDateComponentValue'
          EMAIL: '#/components/schemas/DataEnrichmentEmailComponentValue'
          EMAIL_OTP: '#/components/schemas/DataEnrichmentEmailOtpComponentValue'
          FILE: '#/components/schemas/DataEnrichmentFileComponentValue'
          IT_LOCALITY: '#/components/schemas/DataEnrichmentITLocalityComponentValue'
          PHONE: '#/components/schemas/DataEnrichmentPhoneComponentValue'
          PHONE_OTP: '#/components/schemas/DataEnrichmentPhoneOtpComponentValue'
          SELECT: '#/components/schemas/DataEnrichmentSelectComponentValue'
          TEXT: '#/components/schemas/DataEnrichmentTextComponentValue'
    DataEnrichmentTextComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: TEXT
        textInput:
          type: string
    DataEnrichmentPhoneComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: PHONE_OTP
        prefix:
          type: string
        phoneNumber:
          type: string
    DataEnrichmentPhoneOtpComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: PHONE_OTP
        prefix:
          type: string
        phoneNumber:
          type: string
        otp:
          type: string
    DataEnrichmentEmailComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: EMAIL_OTP
        email:
          type: string
    DataEnrichmentEmailOtpComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: EMAIL_OTP
        email:
          type: string
        otp:
          type: string
    DataEnrichmentDateComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: DATE
        date:
          type: string
          format: date
          example: '1970-01-01T00:00:00.000Z'
    DataEnrichmentSelectComponentValue:
      type: object
      properties:
        type:
          type: string
          default: SELECT
        selectedOptions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
    DataEnrichmentOperatorData:
      type: object
      properties:
        reviewedAt:
          $ref: '#/components/schemas/InstantDateTime'
        originalValue:
          $ref: '#/components/schemas/DataEnrichmentComponentValue'
        userUri:
          type: string
          format: uri
    OperatorReviewStatus:
      type: string
      enum:
        - APPROVED
        - REVISED
        - REJECTED
        - NOT_REVIEWED
    DataEnrichmentSimpleFieldData:
      type: object
      properties:
        id:
          type: string
        labelDisplayId:
          type: string
        templateId:
          type: string
          format: uuid
        value:
          $ref: '#/components/schemas/DataEnrichmentComponentValue'
        status:
          type: string
          enum:
            - FILLING
            - OPERATOR_PENDING
            - VALIDATED
    DataEnrichmentSimpleResponse:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/DataEnrichmentSimpleFieldData'
    DataEnrichmentFileComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: FILE
        resourceId:
          type: string
          format: uuid
    RequestsExportRequest:
      type: object
      description: >
        createdAtStart must be minor than createdAtEnd and the amount of days
        between createdAtStart and

        createdAtEnd must be at most 7 days
      properties:
        organizationId:
          type: string
          format: uuid
        createdAtStart:
          $ref: '#/components/schemas/InstantDateTime'
        createdAtEnd:
          $ref: '#/components/schemas/InstantDateTime'
        requestTypeId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/RequestStatus'
    DataEnrichmentITLocalityComponentValue:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          default: IT_LOCALITY
        countryId:
          type: string
          description: ISO 3166 alpha-2 Country Code
        countryValue:
          type: string
          readOnly: true
        subdivisionId:
          type: string
          description: >
            Field is intended to contain the ISO 1-3 character alphabetic and/or
            numeric code for the

            administrative division of the country concerned (state, province,
            department, etc.),

            as included in International Standard ISO 3166-2/1998 and when
            deemed desirable to enhance

            the use of the code, or when requested by the country concerned.
        subdivisionValue:
          type: string
          readOnly: true
        localityId:
          type: string
          description: >
            UN/LOCODE is a combination of a 2-character country code and a
            3-character location code

            ITNAP is known as the city of Napoli (NAP) which is located in Italy
            (IT)
        localityValue:
          type: string
          readOnly: true
    DocumentDetails:
      type: object
      properties:
        issuanceCountry:
          type: string
          example: IT
          description: |
            Country where the document was issued, in ISO 3166-1 alpha-2 format.
        issuanceAuthority:
          type: string
          example: PREFECTURE
          enum:
            - PREFECTURE
            - POLICE_HEADQUARTERS
            - CIVIL_MOTORIZATION_AUTHORITY
            - MINISTRY_OF_INFRASTRUCTURE_AND_TRANSPORT_CENTRAL_OPERATIONS_OFFICE
            - ITALIAN_REPRESENTATION_ABROAD
            - MINISTRY_OF_FOREIGN_AFFAIRS
          description: >
            Name of the authority that issued the document. **Note:** If
            `issuanceCountry` is `"IT"`, this field is **required only when**
            `type` is `"DrivingLicense"`. Optional otherwise.
        type:
          type: string
          example: Passport
          enum:
            - IdentityCard
            - Passport
            - DrivingLicense
          description: |
            Type of the identity document. Can be one of:
            - `IdentityCard` - `Passport` - `DrivingLicense`
        number:
          type: string
          example: AB1234567
          description: |
            Unique identifier or number of the document.
        issuedOn:
          type: string
          example: '2024-01-15'
          description: |
            Date on which the document was issued (ISO 8601 format).
        expiryDate:
          type: string
          example: '2034-01-14'
          description: >
            Date on which the document expires (ISO 8601 format).

            **Note:** If `issuanceCountry` is `"IT"`, this field is **required
            only when** `type` is `"DrivingLicense"`. Optional otherwise.
    IdentityVerification:
      type: object
      properties:
        documentDetails:
          $ref: '#/components/schemas/DocumentDetails'
    DigitalFootprint:
      type: object
      properties:
        ipAddress:
          type: string
    DthPostRequest:
      type: object
      required:
        - requestTypeId
      properties:
        referenceId:
          type: string
        requestTypeId:
          type: string
        parameters:
          type: object
          properties:
            firstName:
              type: string
            lastName:
              type: string
            phoneNumber:
              type: string
            email:
              type: string
            personalNumber:
              type: string
            gender:
              type: string
            birthDate:
              type: string
            nationality:
              type: string
            identityVerification:
              $ref: '#/components/schemas/IdentityVerification'
            digitalFootprint:
              $ref: '#/components/schemas/DigitalFootprint'
    DthPostResponse:
      type: object
      properties:
        id:
          type: string
    DhtSAVerification:
      type: object
      properties:
        name:
          type: string
    DthGetResponse:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        digitalFootprintScore:
          type: string
        identityDocumentScore:
          type: string
    InternalOperatorStepStatus:
      type: string
      enum:
        - NOT_REQUIRED
        - REQUIRED
        - RESOLVED
    ResourceArchiveRequest:
      type: object
      properties:
        urlValidBefore:
          $ref: '#/components/schemas/InstantDateTime'
        disposition:
          $ref: '#/components/schemas/DownloadContentDisposition'
        includeUnavailable:
          type: boolean
        orFilters:
          type: array
          items:
            type: object
            title: ResourceLinkRequestFilter
            properties:
              type:
                $ref: '#/components/schemas/ResourceType'
              subtype:
                $ref: '#/components/schemas/ResourceSubType'
              family:
                $ref: '#/components/schemas/ResourceFamily'
              linkedToIdentificationId:
                type: string
                format: uuid
    ResourceArchiveResponse:
      example: raw binary data
      type: object
      properties:
        dummy:
          type: string
    ResourceLinkRequest:
      allOf:
        - $ref: '#/components/schemas/ResourceArchiveRequest'
      type: object
      properties:
        downloadArchive:
          type: boolean
    TerminationReason:
      type: string
      description: |
        - "ERROR_OPERATOR_WRONG_FIRSTNAME"
        - "ERROR_OPERATOR_WRONG_SURNAME"
        - "ERROR_OPERATOR_INVERSION_FIRSTNAME_SURNAME"
        - "ERROR_OPERATOR_WRONG_BIRTH_DATE"
        - "ERROR_OPERATOR_WRONG_BIRTH_PLACE"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_ISSUED_COUNTRY"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_EXPIRE_DATE"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_ISSUING_AUTHORITY"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_ISSUING_AUTHORITY_TYPE"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_NUMBER"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_ISSUING_DATE"
        - "ERROR_OPERATOR_WRONG_DOCUMENT_TYPE"
        - "ERROR_OPERATOR_WRONG_FISCAL_CODE"
        - "ERROR_OPERATOR_OTHER"
        - "ERROR_DH_IDENTITY_VERIFICATION_VALIDATION"
        - "ERROR_IDENTITY_OPERATOR_CANCELLED"
        - "ERROR_IDENTITY_FIELD_REQUEST_NOT_MATCHED"
        - "ERROR_IDENTITY_ID_SELF"
        - "ERROR_IDENTITY_ID_SELF_NULL_REQUEST_INFO"
        - "ERROR_IDENTITY_ID_SELF_NULL_DOCUMENT_CONTROLS_SUMMARY"
        - "ERROR_IDENTITY_ID_SELF_NULL_DOCUMENT_CHECK_RESPONSE_REQUEST_INFO"
        - "ERROR_IDENTITY_ID_SELF_NULL_BIOMETRY_RESPONSE"
        - "ERROR_IDENTITY_ID_SELF_NULL_BIOMETRY_CONTROLS_SUMMARY"
        - "ERROR_IDENTITY_ID_SELF_NULL_BIOMETRY_RESPONSE_REQUEST_INFO"
        - "ERROR_IDENTITY_ID_SELF_NULL_DOCUMENT_TYPE"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_TYPE_NOT_ALLOWED"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_EXPIRED"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_SPECIMEN"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_NO_BACK_SIDE_FOUND"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_NO_FRONT_SIDE_FOUND"
        - "ERROR_IDENTITY_ID_SELF_NULL_DOCUMENT_CHECK_RESPONSE"
        - "ERROR_IDENTITY_ID_SELF_IDENTIFICATION_FAILED"
        - "ERROR_IDENTITY_ID_SELF_HOLDER_INFO_MISMATCH"
        - "ERROR_IDENTITY_ID_SELF_VIDEO_RECORDING_COULD_NOT_BE_ACHIEVED"
        - "ERROR_IDENTITY_ID_SELF_MISSING_PARAMETER"
        - "ERROR_IDENTITY_ID_SELF_INVALID_PARAMETER"
        - "ERROR_IDENTITY_ID_SELF_INVALID_URL"
        - "ERROR_IDENTITY_ID_SELF_BAD_QUALITY"
        - "ERROR_IDENTITY_ID_SELF_RECORDING_EXPIRED_OR_CANCELLED"
        - "ERROR_IDENTITY_ID_SELF_TOO_LARGE_CONTENT"
        - "ERROR_IDENTITY_ID_SELF_MRZ_BROKEN_INCOMPLETE_OR_NOT_FOUND"
        - "ERROR_IDENTITY_ID_SELF_BIOMETRY_FACE_DETECTION_ISSUES"
        - "ERROR_IDENTITY_ID_SELF_DOCUMENT_TYPE_AND_REQUESTED_TYPE_MISMATCH"
        - "ERROR_IDENTITY_ID_SELF_UNSUPPORTED_BANK"
        - "ERROR_IDENTITY_ID_SELF_LIVE_CHECK_CAN_NOT_BE_PERFORMED"
        - "ERROR_SIGN_INVALID_PHONE_NUMBER"
        - "ERROR_SIGN_INVALID_HOLDER_INFORMATION"
        - "ERROR_SIGN_MISSING_REQUEST_INFORMATION"
        - "CANCELLED_BY_USER"
        - "ERROR_IDENTITY_ID_SELF_STATUS_NOT_DONE"
    OperatorMode:
      type: string
      enum:
        - DISABLED
        - OPTIONAL
        - REQUIRED
      default: DISABLED
    OperatorConfiguration:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/OperatorMode'
        revisable:
          type: boolean
          default: false
      required:
        - mode
        - revisable
