openapi: 3.0.0
info:
  title: Triveria Wallet API
  description: >
    Triveria Wallet API allows to manage credentials inside a specific wallet
    and interactions between wallets as specified

    by the OIDC4VC specification.
  version: 1.0.0
servers:
  - url: /api/v1
    description: ''
paths:
  /health:
    get:
      operationId: HealthCheck
      responses:
        '200':
          description: Wallet health check
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthStatus'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /{wallet_id}/did.json:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    get:
      operationId: DidDocumentGet
      description: Gets the DID Document of the wallet.
      responses:
        '200':
          description: DID Document
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /did:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    get:
      operationId: DidGet
      security:
        - accessToken: []
      responses:
        '200':
          description: Wallet DID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Did'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    get:
      parameters:
        - in: query
          name: interaction
          description: >
            The interaction that is the origin of the credential. This parameter
            is mutually exclusive with the "type" parameter.
          schema:
            type: string
            enum:
              - issuance
              - receive
              - statusList
              - taoCredentials
        - in: query
          name: type
          description: >
            The credential type as comma delimited list representing a single
            type. This parameter is mutually exclusive with the "interaction"
            parameter.

            I.e. VerifiableCredential,VerifiableAttestation,Europass.
          schema:
            type: string
        - in: query
          name: valid
          description: >-
            The credential validity flag. If not provided credentials with any
            validity will be returned.
          schema:
            type: boolean
        - in: query
          name: limit
          description: The number of items
          schema:
            type: integer
        - in: query
          name: nextMarker
          description: Marking the next set of items
          schema:
            type: string
        - in: query
          name: sort
          description: Sort flag controls the sort direction by the time updated or issued
          schema:
            $ref: '#/components/schemas/ListSort'
        - in: query
          name: searchPath
          description: JSON path specification for the filter to apply
          schema:
            type: string
        - in: query
          name: filter
          description: JSON schema filter used to select the credentials (base64 encoded)
          schema:
            type: string
            format: byte
      operationId: CredentialList
      security:
        - accessToken: []
      responses:
        '200':
          description: Verifiable Credentials list resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialList'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: Retrieves a list of credentials.
    post:
      operationId: CredentialCreate
      security:
        - accessToken: []
      description: |
        Creates a new draft credential.
      requestBody:
        description: |
          A Verifiable Credential payload in JSON format.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialPayload'
      responses:
        '200':
          description: An identifier of the newly created Credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialIdObject'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/import:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      description: Import pre-signed credential into wallet
      operationId: CredentialImport
      security:
        - accessToken: []
      requestBody:
        description: |
          A Verifiable Credential payload in JSON format.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialImport'
      responses:
        '200':
          description: The imported Verifiable Credential object in JSON format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/request/init:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: CredentialRequestInit
      description: >
        Requests a credential issuance from the issuer and retrieves
        requirements 

        for holder authorization.
      security:
        - accessToken: []
      requestBody:
        description: |
          A Verifiable Credential request: types and URL of the issuer
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialRequest'
      responses:
        '200':
          description: Type and details of the authorization required for the interaction.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CredentialId'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/{credential_id}:
    parameters:
      - in: path
        name: credential_id
        required: true
        description: Verifiable Credential Identifier
        schema:
          $ref: '#/components/schemas/CredentialId'
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    get:
      operationId: CredentialGet
      security:
        - accessToken: []
      responses:
        '200':
          description: >
            Wrapped Verifiable Credentials

            - vc: for an easy access that gives you clear structure to work with
            in your app

            - metadata: pay special attention to the `status` key that will
            provide info on validity

            - signedVc: the actual base64 encoded Verifiable Credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialWrapper'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: >
        Retrieves a specific verifiable credential based on the provided
        identifier. 

        Upon retrieval the status of the credential is checked on the fly and
        therefore guaranteed.
    patch:
      operationId: CredentialPatch
      security:
        - accessToken: []
      description: >
        Endpoint used to update an existing Credential in draft state. Can be
        used for additional updates

        before the Credential is issued. After credential is issued it may not
        be changed in any way.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialPatchPayload'
      responses:
        '200':
          description: The updated Credential identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialIdObject'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/{credential_id}/metadata:
    parameters:
      - in: path
        name: credential_id
        required: true
        description: Verifiable Credential Identifier
        schema:
          $ref: '#/components/schemas/CredentialId'
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    patch:
      operationId: CredentialMetadataPatch
      security:
        - accessToken: []
      description: >
        Verifiable Credential metadata may be updated even after the credential
        was issued. It is available as a key 

        value storage for a client to store any additional data for the
        credential.
      requestBody:
        description: |
          Verifiable Credential metadata in JSON
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialMetadataPatchPayload'
      responses:
        '200':
          description: Credential identifier for which metadata was updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialIdObject'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/{credential_id}/issue/init:
    parameters:
      - in: path
        name: credential_id
        required: true
        schema:
          type: string
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: CredentialIssuanceInit
      security:
        - accessToken: []
      description: >
        Prepares created Verifiable Credential draft for its issuance for a
        specific client.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialIssuanceInit'
      responses:
        '200':
          description: |
            The ID of the credential in the issuance queue.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialIssuanceInitResult'
        '204':
          description: Credential was prepared for issuance for a specified client.
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /credentials/{credential_id}/revoke:
    parameters:
      - in: path
        name: credential_id
        required: true
        description: Verifiable Credential Identifier
        schema:
          $ref: '#/components/schemas/CredentialId'
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: CredentialRevoke
      description: Revoke a specific Verifiable Credential
      security:
        - accessToken: []
      responses:
        '204':
          description: Verifiable Credential was successfully revoked
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /deferred/{deferred_id}:
    parameters:
      - in: path
        name: deferred_id
        required: true
        description: Deferred token
        schema:
          type: string
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    get:
      operationId: DeferredStatus
      security:
        - accessToken: []
      responses:
        '200':
          description: >
            The status of the operation if it is in progress, additionally the
            ID of the credential is set if 

            the operations is completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deferred'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /id-token/request:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: IdTokenRequestCreate
      description: |
        Creates an ID token request.
      security:
        - accessToken: []
      responses:
        '200':
          description: Constructed ID token request and its id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdTokenRequest'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /offer/create/intime:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: HolderCreateAuthOffer
      description: >
        Creates an authorized credential offer (deferred or instant) for
        holder-initiated credential request

        using provided parameters. The offer is an URL that the creator should
        provide to the client via a redirect,

        link, or QR code.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HolderAuthOfferCreationRequest'
      responses:
        '200':
          description: Constructed offer URL
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /verifier/init:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyInitRequest'
      operationId: VerifierInitUrlCreate
      description: Returns an url where verifier accepts presentations from a holder.
      security:
        - accessToken: []
      responses:
        '200':
          description: Url for credential verification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyInitResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /verifier/linked-vp:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
      - in: query
        name: did
        required: true
        schema:
          type: string
    post:
      operationId: VerifierLinkedVpVerify
      description: Fetches linked presentations from DID document and verifies them.
      security:
        - accessToken: []
      responses:
        '200':
          description: List of verified presentations
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VerifiedLinkedVp'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /issuer/credential/types:
    parameters:
      - in: query
        name: url
        required: true
        schema:
          type: string
    get:
      operationId: IssuerCredentialTypesList
      description: >
        Returns verifiable credential format and types that are supported by the
        issuer.
         - format: the verifiable credential format (for example "jwt_vc")
         - type: a list of strings that define supported verifiable credential type(s)
      responses:
        '200':
          description: Credential types successfully listed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialTypes'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /issuer/offer/preauth:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: IssuerInitiatePreauthOffer
      description: |
        Initiates issuing of Verifiable Credentials using pre-authorized flow.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitPreAuthOffer'
      responses:
        '200':
          description: >
            On success returns the pre-authorized offer data: issuer url,
            preauthorized code, and pin.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreAuthOffer'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /issuer/offer/auth:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: IssuerInitiateAuthOffer
      description: |
        Initiates issuing of Verifiable Credentials using authorized flow.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitAuthOffer'
      responses:
        '200':
          description: |
            On success returns the authorized offer data: issuer url, and state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthOffer'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/offer/pass-auth-info:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: HolderOfferPassAuthInfo
      description: Issue the Verifiable Credential using OIDC4VCI offer acceptance
      security:
        - accessToken: []
      requestBody:
        description: |
          Offer URL and optional PIN for the request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VcOffer'
      responses:
        '200':
          description: >-
            Authorization requirements in order for the credential offer to
            continue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionAuthorizationRequirements'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/offer/{interaction_id}/process:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
      - in: path
        name: interaction_id
        required: true
        schema:
          type: string
    post:
      operationId: HolderOfferProcessAfterConsent
      description: Gives consent to process credential offer specified by `interaction_id`
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionAuthorizationConsent'
      responses:
        '200':
          description: The ID of the received verifiable credential
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CredentialId'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/id-token/send:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: HolderIdTokenSend
      description: Responds to an ID token request
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdTokenSendRequest'
      responses:
        '204':
          description: Id token successfully sent
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/present/pass-auth-info:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    post:
      operationId: HolderPresentPassAuthInfo
      description: |
        Initiates a presentation of credentials to a verifier.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresentationRequest'
      responses:
        '200':
          description: >-
            Returns the presentation definition wrapped in
            AuthorisationRequirements
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionAuthorizationRequirements'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Not found, caused by no credentials that could be presented
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/present/{interaction_id}:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
      - in: path
        name: interaction_id
        required: true
        schema:
          type: string
    post:
      operationId: HolderCredentialsPresentAfterConsent
      description: |
        Presenting Verifiable Credentials after holder's consent.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionAuthorizationConsent'
      responses:
        '204':
          description: Credentials were successfully presented and verified
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/linked-vp:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
    get:
      operationId: HolderLinkedVpList
      responses:
        '200':
          description: List of linked VPs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedVpList'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: HolderLinkedVpCreate
      description: >
        Creates a new public Linked VP of specified credentials and adds it to
        the wallet's DID document
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkedVpCreateRequest'
      responses:
        '200':
          description: Linked VP was created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedVpMetadata'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /holder/linked-vp/{linked_vp_id}:
    parameters:
      - in: header
        name: wallet-id
        required: true
        schema:
          type: string
      - in: path
        name: linked_vp_id
        required: true
        schema:
          type: string
    get:
      operationId: HolderLinkedVpGetDetails
      responses:
        '200':
          description: Returns linked VP
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedVpMetadata'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: HolderLinkedVpDelete
      description: |
        Deletes a linked VP
      responses:
        '204':
          description: Linked VP was deleted successfully
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets:
    get:
      parameters:
        - in: query
          name: ownerId
          required: false
          schema:
            type: string
      operationId: WalletList
      description: |
        Provides list of wallets owned by the authenticated client.
      security:
        - accessToken: []
      responses:
        '200':
          description: The wallet list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletList'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: WalletCreate
      description: |
        Creates a new wallet for the authenticated client.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wallet'
      responses:
        '200':
          description: >
            The wallet was successfully configured and initiated for the
            authenticated owner (if not already initiated).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletIdObject'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    get:
      operationId: WalletGet
      description: |
        Provides wallet details
      security:
        - accessToken: []
      responses:
        '200':
          description: The wallet details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    patch:
      operationId: WalletPatch
      description: |
        Update wallet metadata and configuration.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wallet'
      responses:
        '200':
          description: The updated Wallet identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletIdObject'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: WalletDelete
      description: |
        Permanently deletes the wallet with all credentials and keys. 
        Make sure you know what you are doing before hitting this endpoint.
      security:
        - accessToken: []
      responses:
        '204':
          description: The wallet was deleted
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}/keys:
    parameters:
      - in: path
        name: wallet_id
        required: true
        description: Wallet ID
        schema:
          type: string
    get:
      operationId: WalletKeys
      description: |
        Provides wallet keys used for signing.
      security:
        - accessToken: []
      responses:
        '200':
          description: Wallet keys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletKeys'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}/notifications:
    parameters:
      - in: path
        name: wallet_id
        required: true
        description: Wallet ID
        schema:
          type: string
    get:
      operationId: WalletNotifications
      description: >
        Provides first-in-first-out queue of notifications for a specific
        wallet.
      security:
        - accessToken: []
      responses:
        '200':
          description: List of notifications for the wallet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletNotificationList'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}/notification_history:
    parameters:
      - in: path
        name: wallet_id
        required: true
        description: Wallet ID
        schema:
          type: string
      - in: query
        name: limit
        description: The number of items
        schema:
          type: integer
      - in: query
        name: nextMarker
        description: Marking the next set of items
        schema:
          type: string
      - in: query
        name: type
        description: Notification types
        schema:
          type: array
          items:
            $ref: '#/components/schemas/WalletNotificationEventType'
      - in: query
        name: sort
        description: Sort flag controls the sort direction by the time created
        schema:
          $ref: '#/components/schemas/ListSort'
    get:
      operationId: WalletNotificationHistory
      description: >
        Provides wallet notifications that can be used to audit the wallet
        activity.
      security:
        - accessToken: []
      responses:
        '200':
          description: Paginated list of notifications for the wallet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletNotificationHistory'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}/notification_history/{state}:
    parameters:
      - in: path
        name: wallet_id
        required: true
        description: Wallet ID
        schema:
          type: string
      - in: path
        name: state
        required: true
        description: Verifier state
        schema:
          type: string
    get:
      operationId: WalletNotificationGetByState
      description: |
        Gets a specific notification by state
      security:
        - accessToken: []
      responses:
        '200':
          description: Wallet notification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletNotification'
        '204':
          description: If there is no notifications for this state
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /wallets/{wallet_id}/verified_credentials/{state}:
    parameters:
      - in: path
        name: wallet_id
        required: true
        description: Wallet ID
        schema:
          type: string
      - in: path
        name: state
        required: true
        description: Verifier state
        schema:
          type: string
    get:
      operationId: WalletVerifiedCredentialsByState
      description: |
        Gets a specific verified credentials by state
      security:
        - accessToken: []
      responses:
        '200':
          description: The result of the successful verification process
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifiedWrapper'
        '204':
          description: If there is no credential for this state
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: WalletVerifiedCredentialsDeleteByState
      description: |
        Deletes a specific verified credentials by state
      security:
        - accessToken: []
      responses:
        '204':
          description: Delete is successfully done
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/prepare-to-onboard:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    post:
      operationId: TfPrepareToOnboard
      description: Prepares another legal entity's wallet DID for onboarding.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareToOnboardRequest'
      responses:
        '204':
          description: Successfully prepared to accreditation
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/onboard-legal-entity:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    post:
      operationId: TfOnboardLegalEntity
      description: >-
        Onboards legal entity to the trust framework based on the wallet
        configuration.
      security:
        - accessToken: []
      responses:
        '200':
          description: The onboarding result containing the onboarded wallet DID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnboardResult'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/accredit-as-trusted-issuer:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    get:
      operationId: TfAccreditAsTrustedIssuer
      description: Accredits the wallet as a trusted issuer.
      security:
        - accessToken: []
      responses:
        '204':
          description: Successfully accredited
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/insert-issuer-proxy:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    get:
      operationId: TfInsertIssuerProxy
      description: >-
        Registers an issuer proxy used by EBSI for the credential status
        retrieval through EBSI network.
      security:
        - accessToken: []
      responses:
        '204':
          description: Successfully inserted
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/accredit:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    post:
      operationId: TfAccreditAs
      description: Accredits a legal entity as RTAO or TAO.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccreditationRequest'
      responses:
        '204':
          description: Successfully accredited
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/prepare-to-accredit:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    post:
      operationId: TfPrepareToAccredit
      description: Prepares another legal entity's wallet DID for accreditation.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareToAccreditRequest'
      responses:
        '204':
          description: Successfully prepared to accreditation
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /tf/{wallet_id}/revoke-accredit:
    parameters:
      - in: path
        name: wallet_id
        required: true
        schema:
          type: string
    post:
      operationId: TfRevokeAccreditation
      description: Revokes another legal entity's wallet DID accreditation.
      security:
        - accessToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevokeAccreditationRequest'
      responses:
        '204':
          description: Successfully prepared to accreditation
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    Oauth2AuthRequest:
      type: string
      description: Please ignore, this is here only to make oapi generators happy.
    Oauth2RedirectUri:
      type: object
      properties:
        redirect_uri:
          type: string
      required:
        - redirect_uri
    Oauth2AccessTokenRequest:
      type: object
      properties:
        grant_type:
          description: Value MUST be set to "authorization_code".
          type: string
        code:
          description: The authorization code received from the.
          type: string
        redirect_uri:
          description: >-
            REQUIRED, if the "redirect_uri" parameter was included in the
            authorization request.
          type: string
        client_id:
          description: >-
            REQUIRED, if the client is not authenticating with the authorization
            server.
          type: string
        client_secret:
          description: >-
            REQUIRED, if the client is not authenticating with the authorization
            server.
          type: string
      required:
        - grant_type
        - code
        - redirect_uri
        - client_id
        - client_secret
    Oauth2AccessToken:
      type: object
      properties:
        access_token:
          type: string
        token_type:
          type: string
        expires_in:
          type: string
      required:
        - access_token
        - token_type
        - expires_in
    Oauth2Profile:
      type: object
      properties:
        user_id:
          type: string
        email:
          type: string
      required:
        - user_id
        - email
    CredentialTypes:
      description: List of verifiable credential types that can be issued by the issuer
      type: array
      items:
        $ref: '#/components/schemas/CredentialType'
    CredentialType:
      description: >
        A credential type that can be issued by the issuer
         - format:  the verifiable credential format (for example "jwt_vc")
         - type: the verifiable credential type, usually provided as list of strings 
        (for example: "VerifiableCredential", "VerifiableAttestation",
        "VerifiableId")
      type: object
      properties:
        format:
          $ref: '#/components/schemas/CredentialFormat'
        type:
          type: array
          items:
            type: string
        doctype:
          type: string
      required:
        - format
    Error:
      description: Common error message
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
        - message
    Did:
      description: Decentralized ID of the wallet owner
      type: object
      properties:
        Did:
          type: string
      required:
        - Did
    Deferred:
      description: >
        The deferred process status. Can be either in progress, or completed, or
        error.

        When the status is completed, the Id property will be set to the value
        of the resulting object ID.
      type: object
      properties:
        Status:
          type: string
          enum:
            - in_progress
            - completed
            - error
        Id:
          type: string
      required:
        - Status
    HealthStatus:
      description: Health status of the system
      title: Health Status
      type: object
      properties:
        status:
          title: Status code
          type: string
          enum:
            - ok
            - limited
            - critical
        subsystems:
          title: The status of individual subsystems
          type: array
          items:
            $ref: '#/components/schemas/SystemImpact'
      required:
        - status
        - subsystems
    SystemImpact:
      title: System impact
      description: The subsystem status impact on the overall system
      type: object
      properties:
        subsystem:
          title: Subsystem name
          type: string
        status:
          title: Subsystem status
          type: string
          enum:
            - ok
            - limited
            - critical
        message:
          title: Status message
          type: string
      required:
        - subsystem
        - status
        - message
    WalletList:
      title: Wallet List
      type: array
      items:
        $ref: '#/components/schemas/WalletListItem'
    WalletListItem:
      title: Wallet List Item
      type: object
      properties:
        walletId:
          $ref: '#/components/schemas/WalletId'
        name:
          type: string
          title: Wallet name
        capabilities:
          title: Wallet capabilities
          type: array
          items:
            $ref: '#/components/schemas/WalletCapability'
      required:
        - walletId
        - name
        - capabilities
    WalletNotificationList:
      title: Notification list for a wallet
      type: array
      items:
        $ref: '#/components/schemas/WalletNotification'
    WalletNotificationHistory:
      title: Permanent notification list for a wallet
      type: object
      properties:
        list:
          $ref: '#/components/schemas/WalletNotificationList'
        next:
          type: string
          format: uri
      required:
        - list
        - next
    WalletNotificationEventType:
      title: Wallet notification event type
      type: string
      enum:
        - vp.verified
        - vp.invalid
        - idToken.received
        - offer.processed
        - offer.initiated
    WalletNotification:
      title: Wallet notification
      type: object
      properties:
        subjectDid:
          title: Subject DID
          type: string
        eventType:
          $ref: '#/components/schemas/WalletNotificationEventType'
        eventDetails:
          type: object
          oneOf:
            - $ref: '#/components/schemas/VpVerifiedNotification'
            - $ref: '#/components/schemas/IdTokenReceivedNotification'
            - $ref: '#/components/schemas/OfferReceivedNotification'
        time:
          title: Event Time
          type: string
          format: date-time
      required:
        - subjectDid
        - eventType
        - message
        - time
    OfferReceivedNotification:
      title: Offer Received
      type: object
      properties:
        credentialType:
          title: Offered credential type
          type: string
        holderDid:
          title: Holder DID
          type: string
        credentialId:
          title: Credential ID
          type: string
      required:
        - credentialType
        - holderDid
    VpVerifiedNotification:
      title: VP verified
      type: object
      properties:
        verifierId:
          title: ID of the verifier used for the presentation and verification
          type: string
      required:
        - verifierId
    IdTokenReceivedNotification:
      title: ID token received
      type: object
      properties:
        idTokenRequestId:
          title: Request ID of the ID token request for which the token was received
          type: string
        clientId:
          title: The ID token Client ID
          type: string
      required:
        - idTokenRequestId
        - clientId
    WalletId:
      title: Wallet ID
      type: string
    WalletIdObject:
      title: Wallet ID object
      type: object
      properties:
        id:
          $ref: '#/components/schemas/WalletId'
      required:
        - id
    Wallet:
      title: Wallet
      description: Wallet details
      type: object
      properties:
        walletId:
          $ref: '#/components/schemas/WalletId'
        name:
          type: string
          title: Wallet name
        capabilities:
          title: Wallet capabilities
          description: >
            This property defines the capabilities which the wallet has. It may
            be any of "holder", "issuer" and "verifier".
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/WalletCapability'
        config:
          $ref: '#/components/schemas/WalletConfig'
      required:
        - name
        - config
    WalletCapability:
      title: Wallet Capability
      description: >
        Defines the capabilities which the wallet has. It may be any of
        "holder", "issuer" and "verifier".
      type: string
      enum:
        - holder
        - issuer
        - verifier
    WalletKeys:
      title: Wallet keys
      description: Wallet keys used for signing
      type: object
      additionalProperties:
        title: Keys information
    WalletConfig:
      title: Wallet config
      description: Wallet specific configuration.
      type: object
      properties:
        credentialIssuers:
          description: >-
            List of credential issuers to be used with credentials of a specific
            type during their issuance.
          type: array
          items:
            $ref: '#/components/schemas/CredentialIssuerDefinition'
        credentialVerifiers:
          description: >
            List of verification definitions that the wallet will be able to use
            for verification process.
          type: array
          items:
            $ref: '#/components/schemas/CredentialVerifierDefinition'
        oidcRevision:
          $ref: '#/components/schemas/OidcRevision'
        trustFramework:
          description: >
            What trust framework should we use with this wallet. This property
            COULD NOT change later.

            Supported frameworks: EBSI - the European Blockchain Services
            Infrastructure, TTS - Triveria Trust Service,

            Noop - did:key based no-op trust framework (mainly for the personal
            use)
          type: string
          enum:
            - EBSI
            - TTS
            - NOOP
        EBSI:
          $ref: '#/components/schemas/EbsiSpecificWalletData'
      required:
        - trustFramework
    OidcRevision:
      description: >
        OIDC specifications are differs drastically from version to version.
        EBSI needs Draft 11 revision, EUDI uses

        Release 1.0 revision, so this field should set the revision wallet uses.
        If omited Draft11 for OIDC4VCI, and 

        Draft16 for OIDC4VP are used for the EBSI compatibility
      type: object
      properties:
        oidc4vci:
          type: string
          enum:
            - Draft11
            - Draft13
            - Release10
        oidc4vp:
          type: string
          enum:
            - Draft16
            - Draft23
    EbsiSpecificWalletData:
      description: EBSI specific data
      type: object
      properties:
        requiredDid:
          type: string
        isOnboarded:
          type: boolean
          default: false
        attributeId:
          type: string
        proxyUrl:
          type: string
        isLegalEntity:
          type: boolean
          description: |
            Defines if the specific wallet is a legal entity
          default: false
        configuration:
          $ref: '#/components/schemas/EbsiConfiguration'
      required:
        - isOnboarded
        - configuration
    EbsiConfiguration:
      description: URLs of EBSI services
      type: object
      properties:
        conformanceClientId:
          type: string
          description: >
            The TAO issuer ID from which this wallet will request onboarding
            credentials
          default: https://api-conformance.ebsi.eu/conformance/v3/issuer-mock
        authorization:
          type: string
          default: https://api-conformance.ebsi.eu/authorisation/v4
        didRegistry:
          type: string
          default: https://api-conformance.ebsi.eu/did-registry/v5
        trustedIssuersRegistry:
          type: string
          default: https://api-conformance.ebsi.eu/trusted-issuers-registry/v5
        trustedSchemasRegistry:
          type: string
          default: https://api-conformance.ebsi.eu/trusted-schemas-registry/v3
        mainSchema:
          type: string
          default: >-
            https://api-pilot.ebsi.eu/trusted-schemas-registry/v3/schemas/z3MgUFUkb722uq4x3dv5yAJmnNmzDFeK5UC8x83QoeLJM
      required:
        - conformanceClientId
        - authorization
        - didRegistry
        - trustedIssuersRegistry
        - trustedSchemasRegistry
        - mainSchema
    IssuerDisplayItem:
      title: Issuer Display item
      type: object
      properties:
        name:
          title: Issuer name
          type: string
        locale:
          title: Display item language
          type: string
        logo:
          $ref: '#/components/schemas/IssuerLogo'
    IssuerLogo:
      title: Issuer Logo
      type: object
      properties:
        uri:
          type: string
        alt_text:
          type: string
    CredentialIssuerDefinition:
      type: object
      properties:
        name:
          description: Human readable template name
          type: string
        id:
          description: Unique identifier of the issuer
          type: string
        credentialType:
          description: >-
            Type of credentials for which the specified credential issuer will
            be used.
          type: array
          items:
            type: string
        credentialIssuer:
          description: Type of issuer to be used with credentials of the type specified.
          type: string
          enum:
            - CtWalletSame
            - CtRevocable
            - IssuanceQueue
            - VPDriven
            - CredentialRequirements
        issuerConfiguration:
          oneOf:
            - $ref: '#/components/schemas/VPDrivenIssuerConfig'
            - $ref: '#/components/schemas/CredentialRequirementsIssuerConfig'
            - $ref: '#/components/schemas/CtWalletSameIssuerConfig'
        credentialFormat:
          description: Format of the issued credential
          type: string
        disclosableClaims:
          description: >
            JSON paths of credential claims which will support being disclosed
            partially.
          type: array
          items:
            type: string
      required:
        - name
        - id
        - credentialType
        - credentialIssuer
    CtWalletSameIssuerConfig:
      properties:
        defaultSchema:
          description: Default credential schema
          type: string
        defaultCredentialSubject:
          description: Default values for the credentialSubject property.
          type: object
    CredentialRequirementsIssuerConfig:
      properties:
        credentialVerifierId:
          description: |
            ID of the verifier used for verification of presented credential.
          type: string
      required:
        - credentialVerifierId
    VPDrivenIssuerConfig:
      properties:
        credentialVerifierId:
          description: |
            ID of the verifier used for verification of presented credential.
          type: string
        mapping:
          description: >
            Mapping of the input values set as JSONPath elements to the output
            credential claims.
          type: object
      required:
        - credentialVerifierId
    IssuanceRequirementsToVerify:
      properties:
        credentialVerifierId:
          description: >
            ID of the verifier used for the verification of presented
            credential.
          type: string
        verifiedFields:
          type: array
          items:
            $ref: '#/components/schemas/FieldsToVerify'
      required:
        - credentialVerifierId
        - verifiedFields
    FieldsToVerify:
      description: |
        Presented credential field that will be matched
      properties:
        path:
          description: |
            JSON Path of the field
          type: string
        value:
          description: |
            Required value of the field
          anyOf:
            - $ref: '#/components/schemas/FieldToVerifyString'
            - $ref: '#/components/schemas/FieldToVerifyNumber'
            - $ref: '#/components/schemas/FieldToVerifyBool'
      required:
        - path
        - value
    FieldToVerifyString:
      type: string
    FieldToVerifyNumber:
      type: number
    FieldToVerifyBool:
      type: boolean
    CredentialRequirements:
      type: object
      properties:
        credentialVerifier:
          type: string
        schema:
          type: string
        expirationDuration:
          description: Expiration interval in seconds
          type: integer
        mapping:
          description: >
            Mapping of the input values set as JSONPath elements to the output
            credential claims.
          type: object
      required:
        - credentialVerifier
        - mapping
        - schema
        - expirationDuration
    PresentationRequest:
      type: object
      properties:
        verifierUrl:
          description: >-
            URL of verifier authorization server. MUST contain the verifier
            scope as a query parameter(`scope`).
          type: string
      required:
        - verifierUrl
    LinkedVpCreateRequest:
      type: object
      properties:
        presentationDefinition:
          $ref: '#/components/schemas/PresentationDefinition'
        credentialsToPresent:
          type: array
          items:
            $ref: '#/components/schemas/InputDescriptorSuitableCredentials'
        expirationDate:
          type: string
          format: date-time
      required:
        - presentationDefinition
        - credentialsToPresent
    LinkedVpMetadata:
      type: object
      properties:
        linkedVpId:
          type: string
        linkedVpUrl:
          type: string
      required:
        - linkedVpId
        - linkedVpUrl
    LinkedVpList:
      type: array
      items:
        $ref: '#/components/schemas/LinkedVpMetadata'
    VerifiedLinkedVp:
      type: object
      properties:
        linkedVpId:
          type: string
        credentials:
          type: array
          items:
            $ref: '#/components/schemas/Credential'
      required:
        - linkedVpId
        - credentials
    VerifyInitRequest:
      type: object
      description: >
        Request for the creation of URL used by holder to present credentials to
        a verifier.
      properties:
        verifierId:
          type: string
      required:
        - verifierId
    VerifyInitResponse:
      type: object
      properties:
        verifierUrl:
          description: >-
            Url of verifier authorization server that contains the requested
            verifier scope.
          type: string
        verifierState:
          description: >-
            A code that can be used to match the verified credential for later
            use.
          type: string
      required:
        - verifierUrl
        - verifierState
    CredentialVerifierDefinition:
      type: object
      properties:
        name:
          description: Human readable name of the definition
          type: string
        id:
          description: Unique ID of the definition
          type: string
        presentationDefinition:
          $ref: '#/components/schemas/PresentationDefinition'
      required:
        - name
        - id
        - presentationDefinition
    PresentationDefinition:
      type: object
      properties:
        id:
          type: string
        format:
          $ref: '#/components/schemas/PresentationDefinitionFormat'
        input_descriptors:
          type: array
          items:
            $ref: '#/components/schemas/PresentationDefinitionInputDescriptor'
        submission_requirements:
          type: array
          items:
            $ref: '#/components/schemas/PresentationDefinitionSubmissionRequirements'
      required:
        - id
        - format
        - input_descriptors
    PresentationDefinitionFormat:
      type: object
      properties:
        jwt_vc:
          $ref: '#/components/schemas/PresentationDefinitionFormatAlg'
        jwt_vp:
          $ref: '#/components/schemas/PresentationDefinitionFormatAlg'
        mso_mdoc:
          $ref: '#/components/schemas/PresentationDefinitionFormatAlg'
    PresentationDefinitionFormatAlg:
      type: object
      properties:
        alg:
          type: array
          items:
            type: string
      required:
        - alg
    PresentationDefinitionSubmissionRequirements:
      type: object
      properties:
        rule:
          type: string
          enum:
            - all
            - pick
        count:
          type: integer
          minimum: 0
        min:
          type: integer
          minimum: 0
        max:
          type: integer
          minimum: 0
        from:
          type: string
        from_nested:
          type: array
          items:
            $ref: '#/components/schemas/PresentationDefinitionSubmissionRequirements'
        name:
          type: string
      required:
        - rule
    PresentationDefinitionInputDescriptor:
      type: object
      properties:
        id:
          type: string
        format:
          $ref: '#/components/schemas/PresentationDefinitionFormat'
        constraints:
          $ref: '#/components/schemas/PresentationDefinitionInputConstraint'
        group:
          type: array
          items:
            type: string
      required:
        - id
        - constraints
    PresentationDefinitionInputConstraint:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/PresentationDefinitionInputConstraintField'
      required:
        - fields
    PresentationDefinitionInputConstraintField:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        purpose:
          type: string
        filter:
          type: object
        path:
          type: array
          items:
            type: string
      required:
        - path
    IdTokenRequest:
      type: object
      properties:
        requestUrl:
          type: string
        id:
          type: string
      required:
        - requestUrl
        - id
    IdTokenSendRequest:
      type: object
      properties:
        requestUrl:
          type: string
      required:
        - requestUrl
    CredentialIssuanceInit:
      description: >
        Request for addition of already created VC draft to issuance queue for a
        client.

        If clientId is used, it will be used as the queue item id, otherwise a
        new ID will be created.
      type: object
      properties:
        issuerId:
          type: string
          title: Issuer ID
          description: >-
            Identifier used by the wallet to decide which issuer to use to issue
            the credential.
        clientId:
          type: string
          title: Client ID
          description: >-
            The future holder identifier. Usually this is the DID of the holder
            wallet.
        idTokenRequestId:
          type: string
          title: ID Token request identifier
          description: If ID Token was used to identify the holder's wallet.
        issuanceRequirementsToVerify:
          $ref: '#/components/schemas/IssuanceRequirementsToVerify'
      required:
        - issuerId
    CredentialIssuanceInitResult:
      type: object
      properties:
        issuanceQueueItemId:
          type: string
          title: >-
            State that should be used when initiating authorization credential
            offers
      required:
        - issuanceQueueItemId
    InitAuthOffer:
      description: >
        Request for authorization flow credential issuance process start.
        Consists of offered credential's types and

        credential offer endpoint (most commonly only schema)
      type: object
      properties:
        issuerId:
          description: ID of the issuer used to issue the credential.
          type: string
        format:
          $ref: '#/components/schemas/CredentialFormat'
        offerEndpoint:
          type: string
          default: openid-credential-offer://
        deferred:
          type: boolean
          default: false
        issuanceQueueItemId:
          description: >
            Id of issuance queue item. Required when issuer type is
            CredentialQueue type

            and no clientId was provided when adding credential to queue.
          type: string
      required:
        - issuerId
        - format
    AuthOffer:
      description: >-
        The authorized flow initiation result consisting of the issuer state and
        URL
      type: object
      properties:
        state:
          type: string
        issuerUrl:
          type: string
        offer:
          type: string
        validUntil:
          type: string
          format: date-time
      required:
        - state
        - issuerUrl
        - offer
        - validUntil
    CredentialFormat:
      type: string
      enum:
        - jwt_vc
        - sd_jwt_vc
    HolderAuthOfferCreationRequest:
      description: Request for the creation of a holder initiated authorized flow offer.
      type: object
      properties:
        issuerUrl:
          type: string
        types:
          type: array
          items:
            type: string
        format:
          $ref: '#/components/schemas/CredentialFormat'
        state:
          type: string
        deferred:
          type: boolean
      required:
        - issuerUrl
        - types
        - state
        - deferred
        - format
    InitPreAuthOffer:
      description: >
        Request for pre-authorized issuance process start. Consists of client id
        or id token request id,

        credential offer endpoint(most commonly only schema) and id's of
        credentials to be issued to client.

        Either clientId or idTokenRequestId MUST be present in the request.
      type: object
      properties:
        clientId:
          description: DID of holder for which the offer is created.
          type: string
        idTokenRequestId:
          description: ID of ID token request issued to the holder.
          type: string
        issuerId:
          description: ID of the issuer used to issue the credential.
          type: string
        format:
          $ref: '#/components/schemas/CredentialFormat'
        offerEndpoint:
          type: string
          default: openid-credential-offer://
        deferred:
          type: boolean
          default: false
      required:
        - credentialTypes
        - format
        - issuerId
    InteractionAuthorizationRequirements:
      type: object
      properties:
        requirementType:
          type: string
          enum:
            - id_token
            - vp_token
            - pin
        presentationDefinition:
          $ref: '#/components/schemas/PresentationDefinition'
        presentationCandidates:
          description: |
            List of credentials suitable for presentation.
          type: array
          items:
            $ref: '#/components/schemas/InputDescriptorSuitableCredentials'
        interactionId:
          type: string
        offeredCredentialsTypes:
          type: array
          items:
            type: string
        issuerDisplay:
          title: Issuer Display
          description: >
            Array of objects, where each object contains display properties of a
            Credential Issuer for a certain language.
          type: array
          items:
            $ref: '#/components/schemas/IssuerDisplayItem'
      required:
        - interactionId
        - requirementType
    InteractionAuthorizationConsent:
      type: object
      properties:
        pin:
          description: |
            Pin code needed for pre-authorized credential offers. 
            Required when authorization requirement type is `pin`
          type: string
        credentialsToPresent:
          description: >
            Array of IDs of credentials that will be presented in the
            interaction.

            Must be a subset of authorization requirements presentation
            candidates.

            Required when authorization requirement type is `vp_token`.
          type: array
          items:
            $ref: '#/components/schemas/InputDescriptorSuitableCredentials'
    InputDescriptorSuitableCredentials:
      type: object
      properties:
        descriptorId:
          description: >
            ID of presentation definition input descriptor for which the
            credential list is suitable.
          type: string
        credentials:
          description: >
            Credential ID list of credentials suitable for presentation
            according to the specified input descriptor.
          type: array
          items:
            $ref: '#/components/schemas/CredentialToPresentWrapper'
      required:
        - descriptorId
        - credentials
    CredentialToPresentWrapper:
      type: object
      properties:
        credential:
          $ref: '#/components/schemas/CredentialMetadata'
        fieldsToDisclose:
          description: >
            Array of json paths of claims that will be disclosed from this
            credential.
          type: array
          items:
            type: string
      required:
        - credential
        - fieldsToDisclose
    PreAuthOffer:
      description: >
        Result of the preauthorized issuance process start. Consists of the
        preauthorized code, pin, and the issuer url.
      type: object
      properties:
        preauthCode:
          type: string
        pin:
          type: string
        issuerUrl:
          type: string
        offer:
          type: string
        validUntil:
          type: string
          format: date-time
      required:
        - preauthCode
        - pin
        - issuerUrl
        - offer
        - validUntil
    CredentialImport:
      type: object
      properties:
        credential:
          type: string
        name:
          type: string
      required:
        - credential
        - name
    CredentialRequest:
      type: object
      properties:
        types:
          type: array
          items:
            type: string
        format:
          $ref: '#/components/schemas/CredentialFormat'
        url:
          type: string
          format: url
        state:
          type: string
      required:
        - url
        - types
        - format
    CredentialId:
      title: Verifiable Credential ID
      type: string
    CredentialIdObject:
      title: Verifiable Credential ID object
      type: object
      properties:
        id:
          $ref: '#/components/schemas/CredentialId'
      required:
        - id
    Credential:
      title: Verifiable Credential
      type: object
      properties:
        '@context':
          title: Context
          description: >
            The value of the @context property MUST be an ordered set where the
            first item is a URL with the value 

            https://www.w3.org/ns/credentials/v2. Subsequent items in the array
            MUST express context information and 

            be composed of any combination of URLs or objects. It is RECOMMENDED
            that each URL in the @context be 

            one which, if dereferenced, results in a document containing
            machine-readable information about the @context.

            https://www.w3.org/TR/vc-data-model-2.0/#contexts
          type: array
          items:
            type: string
        id:
          $ref: '#/components/schemas/CredentialId'
        type:
          title: Credential Type
          description: >
            The value of the type property MUST be, or map to (through
            interpretation of the @context property), 

            one or more URLs. If more than one URL is provided, the URLs MUST be
            interpreted as an unordered set. 

            Syntactic conveniences SHOULD be used to ease developer usage. Such
            conveniences might include JSON-LD terms. 

            It is RECOMMENDED that each URL in the type be one which, if
            dereferenced, results in a document containing 

            machine-readable information about the type. 

            https://www.w3.org/TR/vc-data-model-2.0/#types
          type: array
          items:
            type: string
        credentialSchema:
          $ref: '#/components/schemas/CredentialSchema'
        credentialSubject:
          $ref: '#/components/schemas/CredentialSubject'
        credentialStatus:
          $ref: '#/components/schemas/CredentialStatus'
        evidence:
          $ref: '#/components/schemas/Evidence'
        validFrom:
          title: Valid From
          description: >
            Date Time Stamp string value representing the date and time the
            credential becomes valid

            https://www.w3.org/TR/vc-data-model-2.0/#defn-validFrom
          type: string
          format: date-time
        validUntil:
          title: Valid Until
          description: >
            Date Time Stamp string value representing the date and time the
            credential ceases to be valid

            https://www.w3.org/TR/vc-data-model-2.0/#defn-validUntil
          type: string
          format: date-time
        issued:
          title: Issued
          description: |
            EBSI specific field defining the date of issuance.
          type: string
          format: date-time
        issuanceDate:
          title: Issuance date
          description: |
            EBSI specific field defining the date of issuance.
          type: string
          format: date-time
        expirationDate:
          title: Expiration date
          description: |
            EBSI specific field defining the date of expiration.
          type: string
          format: date-time
        holder:
          title: Verifiable Credential Holder
          description: |
            Either a URL or an object containing an id property
            https://www.w3.org/TR/vc-data-model-2.0/#defn-holder
          type: string
        issuer:
          title: Verifiable Credential Issuer
          description: |
            Either a URL or an object containing an id property
            https://www.w3.org/TR/vc-data-model-2.0/#defn-issuer
          oneOf:
            - $ref: '#/components/schemas/IssuerId'
            - $ref: '#/components/schemas/IssuerMeta'
        _sd:
          title: Credential disclosures
          description: |
            Array of specific VC field disclosures
          type: array
          items:
            type: string
        _sd_alg:
          title: Disclosure algorithm
          description: |
            Algorithm used for hashing disclosure digests
          type: string
        refreshService:
          $ref: '#/components/schemas/RefreshService'
        termsOfUse:
          $ref: '#/components/schemas/TermsOfUse'
        proof:
          $ref: '#/components/schemas/Proof'
      additionalProperties: true
    IssuerMeta:
      title: Verifiable Credential Issuer metadata.
      description: |
        Object containing an `id` property.
      properties:
        id:
          $ref: '#/components/schemas/IssuerId'
      additionalProperties: true
      required:
        - id
    IssuerId:
      title: URL containing the ID of an credential issuer.
      type: string
    Proof:
      title: Verifiable Credential Proof
      description: >
        One or more cryptographic proofs that can be used to detect tampering
        and verify the authorship of a verifiable credential or verifiable
        presentation

        https://www.w3.org/TR/vc-data-model-2.0/#securing-verifiable-credentials
      properties:
        type:
          title: The Proof type
          example: Ed25519Signature2020
          type: string
        created:
          title: Date Time Stamp string representing the Proof creation date
          type: string
          format: date-time
        verificationMethod:
          title: The Proof verification method
          type: string
        proofPurpose:
          title: The Proof assertion method
          example: assertionMethod
          type: string
        proofValue:
          title: The Proof signature value
          type: string
      required:
        - type
        - created
        - verificationMethod
        - proofPurpose
    TermsOfUse:
      title: Terms of Use
      description: |
        Policy under which the creator issued the credential or presentation
        https://www.w3.org/TR/vc-data-model-2.0/#defn-termsOfUse
      properties:
        id:
          title: Terms of Use ID
          type: string
        type:
          title: Terms of Use Type
          example: IssuerPolicy
          type: string
      required:
        - type
      additionalProperties: true
    RefreshService:
      title: Refresh Service
      description: >
        A refresh service is a mechanism that can be utilized by software agents
        to retrieve an updated copy of a Verifiable Credential

        https://www.w3.org/TR/vc-data-model-2.0/#defn-refreshService
      oneOf:
        - $ref: '#/components/schemas/RefreshServiceItem'
        - type: array
          items:
            $ref: '#/components/schemas/RefreshServiceItem'
    RefreshServiceItem:
      properties:
        id:
          title: Refresh Service ID
          description: The URL of the service
          type: string
        type:
          title: Refresh Service Type
          example: ManualRefreshService2018
          type: string
      required:
        - id
        - type
    ObjectId:
      title: Generic Object ID
      type: string
    Evidence:
      title: Evidence
      type: array
      items:
        $ref: '#/components/schemas/EvidenceItem'
    EvidenceItem:
      title: An Evidence item
      description: >
        A scheme providing enough information for a verifier to determine
        whether the evidence gathered by the issuer 

        meets its confidence requirements for relying on the credential
      properties:
        id:
          title: Evidence URL
          description: >-
            URL that points to where more information about this instance of
            evidence can be found
          type: string
        type:
          title: Evidence type
          description: >-
            The precise content of each evidence scheme is determined by the
            specific evidence type definition.
          type: array
          items:
            type: string
      additionalProperties: true
      required:
        - type
    CredentialStatus:
      title: Verifiable Credential Status
      description: >
        It is expected that the value will provide enough information to
        determine the current status of the credential and 

        that machine readable information will be retrievable from the URL

        https://www.w3.org/TR/vc-data-model-2.0/#defn-credentialStatus
      type: object
      properties:
        id:
          title: A URL of the Verified Credential Status
          type: string
        type:
          title: Expresses the credential status type
          type: string
        statusPurpose:
          type: string
        statusListIndex:
          type: string
        statusListCredential:
          type: string
      required:
        - id
        - type
    CredentialSchemaId:
      title: Verifiable Credential Schema ID
      description: A URL identifying the schema file
      type: string
    CredentialSchema:
      title: Verifiable Credential Schema
      description: >
        One or more data schemas that provide verifiers with enough information
        to determine if the provided data conforms to the provided schema(s)

        https://www.w3.org/TR/vc-data-model-2.0/#defn-credentialSchema
      oneOf:
        - $ref: '#/components/schemas/CredentialSchemaItem'
        - type: array
          items:
            $ref: '#/components/schemas/CredentialSchemaItem'
    CredentialSchemaItem:
      title: Credential Schema Item
      type: object
      properties:
        id:
          $ref: '#/components/schemas/CredentialSchemaId'
        name:
          title: Credential Schema Name
          type: string
        type:
          title: Credential Schema Type
          description: Defines the schema type, for example, JsonSchema
          type: string
      additionalProperties: true
      required:
        - id
        - type
    CredentialSubject:
      title: Credential Subject
      description: >
        Set of objects that MUST contain one or more claims that are each
        related to a subject of the verifiable credential

        https://www.w3.org/TR/vc-data-model-2.0/#defn-credentialSubject.

        Currently we support only one subject in the verifiable credential
        because there is no consensus about "vc-jwt"

        encoding of multi-subject verifiable credentials
      oneOf:
        - $ref: '#/components/schemas/CredentialSubjectItem'
        - type: array
          items:
            $ref: '#/components/schemas/CredentialSubjectItem'
    CredentialSubjectItem:
      title: Credential Subject Item
      type: object
      properties:
        id:
          title: Credential Subject ID
          type: string
        _sd:
          title: Credential subject disclosures
          description: |
            Array of specific VC subject field disclosures
          type: array
          items:
            type: string
      additionalProperties: true
    CredentialPayload:
      title: Credential payload
      description: A Credential container used to create credentials with metadata.
      properties:
        credential:
          $ref: '#/components/schemas/Credential'
        name:
          title: Credential name
          description: >-
            An internal credential label used by a holder or issuer as a human
            readable credential name.
          type: string
        validateSchema:
          description: >-
            If true, the credential draft is checked against its schema.
            Defaults to true.
          type: boolean
          default: true
      additionalProperties:
        title: Credential metadata
        description: >-
          Any additional key, value pairs used for internal purposes of an
          issuer or holder.
      required:
        - name
        - credential
    CredentialPatchPayload:
      title: Credential patch payload
      description: A Credential container used to create credentials with metadata.
      properties:
        credentialSubject:
          $ref: '#/components/schemas/CredentialSubject'
        name:
          title: Credential name
          type: string
        validateSchema:
          description: >-
            If true, the credential draft is checked against its schema.
            Defaults to true.
          type: boolean
          default: true
      additionalProperties:
        title: >-
          Any additional key, value pairs used to categorize or denote the
          Credential
        example:
          focus: education
          type: diploma
          origin: SK
      required:
        - name
        - credentialSubject
    CredentialMetadataPatchPayload:
      title: Credential Metadata patch payload
      properties:
        name:
          title: Verifiable Credential name
          type: string
      additionalProperties: true
    CredentialMetadata:
      title: Verifiable Credential metadata
      description: >-
        Any Credential related accompanying key, value pairs that are not part
        of the Issued Credential
      properties:
        id:
          title: Verifiable Credential ID
          type: string
        walletId:
          title: Wallet ID
          type: string
        ownerId:
          title: Owner ID
          type: string
        name:
          title: Verifiable Credential name
          type: string
        interaction:
          title: The interaction that is the origin of the credential.
          type: string
          enum:
            - issuance
            - receive
            - statusList
            - taoCredentials
        message:
          title: Any purpose message accompanied with the credential.
          type: string
        type:
          title: Verifiable Credential type
          type: string
          example: VerifiableCredential,VerifiableAttestation
        offeredToClientId:
          title: Offered to Client ID
          description: In case of issued credential this is the DID of the holder wallet
          type: string
        created:
          title: Created time
          type: string
          format: date-time
        updated:
          title: Updated time
          type: string
          format: date-time
        status:
          title: Verifiable Credential status
          type: string
          enum:
            - draft
            - valid
            - invalid
        disclosableFields:
          title: Fields of the credential that can be partially disclosed
          type: array
          items:
            type: string
        issuerDisplay:
          title: Issuer Display
          description: >
            Array of objects, where each object contains display properties of a
            Credential Issuer for a certain language.
          type: array
          items:
            $ref: '#/components/schemas/IssuerDisplayItem'
      additionalProperties: true
      required:
        - id
        - walletId
        - ownerId
        - interaction
        - status
        - type
        - name
        - created
        - updated
    VerifiedWrapper:
      title: Verified Presentation Wrapper
      description: Wrapped result of successful verification interaction.
      properties:
        credentials:
          type: array
          items:
            $ref: '#/components/schemas/Credential'
        vp:
          title: Verifiable Presentation
          description: >-
            The Verifiable Presentation that was presented during the
            interaction.
          type: string
      required:
        - credentials
        - vp
    CredentialWrapper:
      title: Verifiable Credential Wrapper
      description: >-
        The wrapper contains Verifiable Credential in both, the Credential and
        as Base64 signed format alongside with metadata.
      properties:
        metadata:
          $ref: '#/components/schemas/CredentialMetadata'
        vc:
          $ref: '#/components/schemas/Credential'
        signedVc:
          title: Signed Verifiable Credential
          description: The base64 encoded Verifiable Credential in its final signed form
          type: string
      required:
        - metadata
        - vc
    CredentialList:
      title: Verifiable Credentials list
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/CredentialMetadata'
        next:
          type: string
          format: uri
      required:
        - list
        - next
    VcOffer:
      description: |
        The offer to be accepted. The offer URL is mandatory.
      type: object
      properties:
        Url:
          type: string
          format: url
      required:
        - Url
    OnboardResult:
      description: >-
        On successful EBSI-onboarding result contains "did:ebsi" decentralized
        identifier
      type: object
      properties:
        did:
          type: string
      required:
        - did
    PrepareToOnboardRequest:
      description: Prepares to onboard legal entity's DID
      type: object
      properties:
        did:
          type: string
          description: DID which will be onboarded
        validUntil:
          type: string
          description: Specifies when the authorization to onboard credential will expire
          format: date-time
      required:
        - did
        - validUntil
    PrepareToAccreditRequest:
      description: Prepares to accredit legal entity's DID
      type: object
      properties:
        did:
          type: string
        type:
          type: string
          enum:
            - TrustedIssuer
            - TrustedAccreditationOrganisation
        accreditedFor:
          description: >
            Base64 encoded json to be used for the `accreditedFor` property of
            the credential
          type: string
        validUntil:
          description: Specifies when will the accreditation credential expire
          type: string
          format: date-time
      required:
        - did
        - type
        - accreditedFor
        - validUntil
    RevokeAccreditationRequest:
      description: Info needed to revoke legal entity's DID
      type: object
      properties:
        did:
          type: string
        type:
          type: string
          enum:
            - TrustedIssuer
            - TrustedAccreditationOrganisation
      required:
        - did
        - type
    AccreditationRequest:
      description: Accreditation request of own wallet.
      type: object
      properties:
        type:
          type: string
          enum:
            - TrustedAccreditationOrganisation
            - RootTrustedAccreditationOrganisation
      required:
        - type
    ListSort:
      description: Sort flag controls the sort direction by the time created
      type: string
      enum:
        - asc
        - desc
  responses:
    UnauthorizedError:
      description: Access token is missing or invalid
    BadRequestError:
      description: Bad input detected for the endpoint
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: Not found error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
