basePath: /api/v1
definitions:
  apiv1.AddConsentRequest:
    properties:
      authentic_source:
        type: string
      authentic_source_person_id:
        type: string
      consent_to:
        type: string
      session_id:
        type: string
    required:
    - authentic_source
    - authentic_source_person_id
    type: object
  apiv1.AddDocumentIdentityRequest:
    properties:
      authentic_source:
        description: |-
          required: true
          example: SUNET
        type: string
      document_id:
        description: |-
          required: true
          example: 7a00fe1a-3e1a-11ef-9272-fb906803d1b8
        type: string
      identities:
        items:
          $ref: '#/definitions/model.Identity'
        type: array
      vct:
        description: |-
          required: true
          example: urn:eudi:pid:1
        type: string
    required:
    - authentic_source
    - document_id
    - identities
    - vct
    type: object
  apiv1.DeleteDocumentIdentityRequest:
    properties:
      authentic_source:
        description: |-
          required: true
          example: SUNET
        type: string
      authentic_source_person_id:
        description: |-
          required: true
          example: 83c1a3c8-3e1a-11ef-9c01-6b6642c8d638
        type: string
      document_id:
        description: |-
          required: true
          example: 7a00fe1a-3e1a-11ef-9272-fb906803d1b8
        type: string
      vct:
        description: |-
          required: true
          example: urn:eudi:pid:1
        type: string
    required:
    - authentic_source
    - authentic_source_person_id
    - document_id
    - vct
    type: object
  apiv1.DeleteDocumentRequest:
    properties:
      authentic_source:
        description: |-
          required: true
          example: skatteverket
        type: string
      document_id:
        description: |-
          required: true
          example: 5e7a981c-c03f-11ee-b116-9b12c59362b9
        type: string
      vct:
        description: |-
          required: true
          example: urn:eudi:pid:1
        type: string
    required:
    - authentic_source
    - document_id
    - vct
    type: object
  apiv1.DocumentListReply:
    properties:
      data:
        items:
          $ref: '#/definitions/model.DocumentList'
        type: array
    type: object
  apiv1.DocumentListRequest:
    properties:
      authentic_source:
        type: string
      identity:
        $ref: '#/definitions/model.Identity'
      valid_from:
        type: integer
      valid_to:
        type: integer
      vct:
        type: string
    required:
    - identity
    type: object
  apiv1.GetConsentRequest:
    properties:
      authentic_source:
        type: string
      authentic_source_person_id:
        type: string
    required:
    - authentic_source
    - authentic_source_person_id
    type: object
  apiv1.GetDocumentCollectIDReply:
    properties:
      data:
        $ref: '#/definitions/model.Document'
    type: object
  apiv1.GetDocumentCollectIDRequest:
    properties:
      authentic_source:
        type: string
      collect_id:
        type: string
      identity:
        $ref: '#/definitions/model.Identity'
      vct:
        type: string
    required:
    - authentic_source
    - collect_id
    - identity
    - vct
    type: object
  apiv1.GetDocumentReply:
    properties:
      data:
        $ref: '#/definitions/model.Document'
    type: object
  apiv1.GetDocumentRequest:
    properties:
      authentic_source:
        type: string
      document_id:
        type: string
      vct:
        type: string
    required:
    - authentic_source
    - document_id
    - vct
    type: object
  apiv1.IdentityMappingReply:
    properties:
      data:
        $ref: '#/definitions/model.IDMapping'
    type: object
  apiv1.IdentityMappingRequest:
    properties:
      authentic_source:
        description: |-
          required: true
          example: SUNET
        type: string
      identity:
        $ref: '#/definitions/model.Identity'
    required:
    - authentic_source
    - identity
    type: object
  apiv1.NotificationReply:
    properties:
      data:
        $ref: '#/definitions/openid4vci.QR'
    type: object
  apiv1.NotificationRequest:
    properties:
      authentic_source:
        type: string
      document_id:
        type: string
      vct:
        type: string
    required:
    - authentic_source
    - document_id
    - vct
    type: object
  apiv1.RevokeDocumentRequest:
    properties:
      authentic_source:
        type: string
      revocation:
        $ref: '#/definitions/model.Revocation'
      vct:
        type: string
    required:
    - authentic_source
    - revocation
    - vct
    type: object
  apiv1.RevokeReply:
    properties:
      data:
        properties:
          status:
            type: boolean
        type: object
    type: object
  apiv1.RevokeRequest:
    properties:
      authentic_source:
        type: string
      document_id:
        type: string
      revocation_id:
        type: string
      vct:
        type: string
    type: object
  apiv1_issuer.Credential:
    properties:
      credential:
        type: string
    type: object
  apiv1_issuer.Jwk:
    properties:
      crv:
        type: string
      d:
        type: string
      ext:
        type: boolean
      key_ops:
        items:
          type: string
        type: array
      kid:
        type: string
      kty:
        type: string
      x:
        type: string
      "y":
        type: string
    type: object
  apiv1_issuer.JwksReply:
    properties:
      issuer:
        type: string
      jwks:
        $ref: '#/definitions/apiv1_issuer.Keys'
    type: object
  apiv1_issuer.Keys:
    properties:
      keys:
        items:
          $ref: '#/definitions/apiv1_issuer.Jwk'
        type: array
    type: object
  apiv1_issuer.MakeSDJWTReply:
    properties:
      credentials:
        items:
          $ref: '#/definitions/apiv1_issuer.Credential'
        type: array
    type: object
  helpers.Error:
    properties:
      details: {}
      title:
        type: string
    type: object
  helpers.ErrorResponse:
    properties:
      error:
        $ref: '#/definitions/helpers.Error'
    type: object
  model.Collect:
    properties:
      id:
        description: |-
          required: false
          example: 98fe67fc-c03f-11ee-bbee-4345224d414f
        type: string
      valid_until:
        description: |-
          required: false
          example: 509567558
          format: int64
        type: integer
    type: object
  model.Consent:
    properties:
      consent_to:
        description: |-
          required: true
          example: "Using my data for research"
        type: string
      created_at:
        description: |-
          required: true
          example: 509567558
          format: int64
        type: integer
      session_id:
        description: |-
          required: true
          example: "sess-123"
        type: string
    required:
    - consent_to
    - created_at
    - session_id
    type: object
  model.Document:
    properties:
      document_data: {}
      meta:
        $ref: '#/definitions/model.MetaData'
    required:
    - document_data
    - meta
    type: object
  model.DocumentDisplay:
    properties:
      description_structured:
        additionalProperties: {}
        description: |-
          DescriptionStructured is a map of structured descriptions
          required: true
          example: {"en": "European Health Insurance Card", "sv": "Europeiskt sjukförsäkringskortet"}
        type: object
      type:
        description: |-
          required: true
          example: secure
        type: string
      version:
        description: |-
          required: true
          example: "1.0.0"
        type: string
    required:
    - description_structured
    - type
    - version
    type: object
  model.DocumentList:
    properties:
      document_display:
        $ref: '#/definitions/model.DocumentDisplay'
      meta:
        $ref: '#/definitions/model.MetaData'
      qr:
        $ref: '#/definitions/openid4vci.QR'
    required:
    - meta
    - qr
    type: object
  model.IDMapping:
    properties:
      authentic_source_person_id:
        type: string
    type: object
  model.Identity:
    properties:
      age_birth_year:
        type: integer
      age_in_years:
        type: integer
      age_over_14:
        type: string
      age_over_16:
        type: boolean
      age_over_18:
        type: boolean
      age_over_21:
        type: boolean
      age_over_65:
        type: boolean
      authentic_source_person_id:
        description: |-
          required: true
          example: 65636cbc-c03f-11ee-8dc4-67135cc9bd8a
        type: string
      birth_date:
        description: |-
          required: true
          example: 1970-01-01 TODO: Day, month, and year?
        type: string
      birth_family_name:
        maxLength: 100
        minLength: 1
        type: string
      birth_given_name:
        maxLength: 100
        minLength: 1
        type: string
      birth_place:
        description: |-
          required: true
          example: Stockholm
        maxLength: 100
        minLength: 2
        type: string
      document_number:
        description: |-
          required: false
          example:
        type: string
      email_address:
        description: |-
          required: false
          example: <email-address>
        type: string
      expiry_date:
        description: |-
          required: false
          example: Date (and if possible time)
        type: string
      family_name:
        description: |-
          required: true
          example: Svensson
        maxLength: 100
        minLength: 1
        type: string
      given_name:
        description: |-
          required: true
          example: Magnus
        maxLength: 100
        minLength: 1
        type: string
      issuance_date:
        type: string
      issuing_authority:
        description: |-
          required: false
          example:
        type: string
      issuing_country:
        description: |-
          required: false
          example:
        type: string
      issuing_jurisdiction:
        description: |-
          required: false
          example:
        type: string
      mobile_phone_number:
        description: |-
          required: false
          example: <+mobile-phone-number>
        type: string
      nationality:
        description: |-
          required: true
          example: SE
        items:
          type: string
        type: array
      personal_administrative_number:
        description: |-
          required: false
          example: <personnummer>
        maxLength: 50
        minLength: 4
        type: string
      picture:
        description: |-
          required: false
          example: facial image compliant with ISO 19794-5 or ISO 39794 specifications
        type: string
      resident_address:
        description: |-
          required: false
          example: 221b Baker street
        type: string
      resident_city:
        description: |-
          required: false
          example: London
        type: string
      resident_country:
        description: |-
          required: false
          example: England
        type: string
      resident_house_number:
        description: |-
          required: false
          example: 221b
        type: string
      resident_postal_code:
        description: |-
          required: false
          example: W1U 6SG
        type: string
      resident_state:
        description: |-
          required: false
          example: england
        type: string
      resident_street_address:
        description: |-
          required: false
          example: Baker street
        maxLength: 100
        minLength: 1
        type: string
      schema:
        $ref: '#/definitions/model.IdentitySchema'
      sex:
        description: |-
          required: false
          example: 0 = not known, 1 = male, 2 = female, ...
        enum:
        - "0"
        - "1"
        - "2"
        - "3"
        - "4"
        - "5"
        - "6"
        - "7"
        - "8"
        - "9"
        type: string
      trust_anchor:
        type: string
    required:
    - birth_date
    - family_name
    - given_name
    - schema
    type: object
  model.IdentitySchema:
    properties:
      name:
        description: |-
          required: true
          example: "SE"
        type: string
      version:
        description: |-
          required: false
          example: "1.0.0"
        type: string
    required:
    - name
    type: object
  model.MetaData:
    properties:
      authentic_source:
        description: |-
          required: true
          example: SUNET
        type: string
      collect:
        $ref: '#/definitions/model.Collect'
      credential_valid_from:
        description: |-
          required: false
          example: 509567558
          format: int64
        type: integer
      credential_valid_to:
        description: |-
          required: false
          example: 509567558
          format: int64
        type: integer
      document_data_validation:
        description: |-
          required: false
          example: file://path/to/schema.json or http://example.com/schema.json
          format: string
        type: string
      document_id:
        description: |-
          required: true
          example: 5e7a981c-c03f-11ee-b116-9b12c59362b9
        type: string
      document_version:
        description: |-
          required: true
          example: "1.0.0"
        type: string
      real_data:
        description: |-
          RealData is a flag to indicate if the document contains real data
          required: true
          example: true
        type: boolean
      revocation:
        allOf:
        - $ref: '#/definitions/model.Revocation'
        description: Revocation is a collection of fields representing a revocation
      vct:
        description: |-
          VCT is the Verifiable Credential Type
          required: true
          example: "urn:eudi:pid:1"
        type: string
    required:
    - authentic_source
    - document_id
    - document_version
    - vct
    type: object
  model.Revocation:
    properties:
      id:
        description: |-
          ID is the ID of the revocation
          required: false
          example: 8dbd2680-c03f-11ee-a21b-034aafe41222
        type: string
      reason:
        description: |-
          Reason is the reason for revocation
          required: false
          example: lost or stolen
        type: string
      reference:
        $ref: '#/definitions/model.RevocationReference'
      revoked:
        description: |-
          Revoked is a flag to indicate if the document has been revoked
          required: false
          example: false
        type: boolean
      revoked_at:
        description: |-
          RevokedAt is the time the document was revoked or going to be revoked
          required: false
          example: 509567558
          format: int64
        type: integer
    type: object
  model.RevocationReference:
    properties:
      authentic_source:
        type: string
      document_id:
        type: string
      vct:
        type: string
    type: object
  openid4vci.CredentialRequest:
    properties:
      credential_identifier:
        description: REQUIRED when credential_identifiers parameter was returned from
          the Token Response. It MUST NOT be used otherwise. It is a String that identifies
          a Credential that is being requested to be issued. When this parameter is
          used, the format parameter and any other Credential format specific parameters
          such as those defined in Appendix A MUST NOT be present.
        type: string
      credential_response_encryption:
        allOf:
        - $ref: '#/definitions/openid4vci.CredentialResponseEncryption'
        description: CredentialIdentifier REQUIRED when credential_identifiers parameter
          was returned from the Token Response. It MUST NOT be used otherwise. It
          is a String that identifies a Credential that is being requested to be issued.
          When this parameter is used, the format parameter and any other Credential
          format specific parameters such as those defined in Appendix A MUST NOT
          be present.
      format:
        description: Format REQUIRED when the credential_identifiers parameter was
          not returned from the Token Response. It MUST NOT be used otherwise. It
          is a String that determines the format of the Credential to be issued, which
          may determine the type and any other information related to the Credential
          to be issued. Credential Format Profiles consist of the Credential format
          specific parameters that are defined in Appendix A. When this parameter
          is used, the credential_identifier Credential Request parameter MUST NOT
          be present.
        type: string
      headers:
        $ref: '#/definitions/openid4vci.CredentialRequestHeader'
      proof:
        allOf:
        - $ref: '#/definitions/openid4vci.Proof'
        description: 'Proof OPTIONAL. Object containing the proof of possession of
          the cryptographic key material the issued Credential would be bound to.
          The proof object is REQUIRED if the proof_types_supported parameter is non-empty
          and present in the credential_configurations_supported parameter of the
          Issuer metadata for the requested Credential. The proof object MUST contain
          the following:'
    type: object
  openid4vci.CredentialRequestHeader:
    properties:
      authorization:
        type: string
      dpoP:
        type: string
    required:
    - authorization
    - dpoP
    type: object
  openid4vci.CredentialResponseEncryption:
    properties:
      alg:
        type: string
      enc:
        type: string
      jwk:
        $ref: '#/definitions/openid4vci.JWK'
    required:
    - alg
    - enc
    - jwk
    type: object
  openid4vci.JWK:
    properties:
      crv:
        type: string
      d:
        type: string
      kid:
        type: string
      kty:
        type: string
      x:
        type: string
      "y":
        type: string
    required:
    - crv
    - d
    - kid
    - kty
    - x
    - "y"
    type: object
  openid4vci.Proof:
    properties:
      attestation:
        type: string
      jwt:
        type: string
      ldp_vp:
        type: string
      proof_type:
        description: ProofType REQUIRED. String denoting the key proof type. The value
          of this parameter determines other parameters in the key proof object and
          its respective processing rules. Key proof types defined in this specification
          can be found in Section 7.2.1.
        enum:
        - jwt
        - ldp_vp
        - cwt
        type: string
    required:
    - proof_type
    type: object
  openid4vci.QR:
    properties:
      credential_offer_url:
        type: string
      qr_base64:
        type: string
    type: object
  vcclient.UploadRequest:
    properties:
      document_data:
        additionalProperties: {}
        type: object
      document_data_version:
        type: string
      document_display:
        $ref: '#/definitions/model.DocumentDisplay'
      identities:
        items:
          $ref: '#/definitions/model.Identity'
        type: array
      meta:
        $ref: '#/definitions/model.MetaData'
    required:
    - document_data
    - document_data_version
    - meta
    type: object
info:
  contact: {}
  title: Datastore API
  version: "2.8"
paths:
  /consent:
    post:
      consumes:
      - application/json
      description: Add consent endpoint
      operationId: add-consent
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.AddConsentRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: AddConsent
      tags:
      - vc-platform
  /consent/get:
    post:
      consumes:
      - application/json
      description: Get consent endpoint
      operationId: get-consent
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.GetConsentRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/model.Consent'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: GetConsent
      tags:
      - vc-platform
  /credential:
    post:
      consumes:
      - application/json
      description: Create credential endpoint
      operationId: create-credential
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/openid4vci.CredentialRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1_issuer.MakeSDJWTReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: OIDCCredential
      tags:
      - vc-platform
  /credential/.well-known/jwks:
    get:
      consumes:
      - application/json
      description: JWKS endpoint
      operationId: issuer-JWKS
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1_issuer.JwksReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: JWKS
      tags:
      - vc-platform
  /document:
    delete:
      consumes:
      - application/json
      description: delete one document endpoint
      operationId: delete-document
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.DeleteDocumentRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: DeleteDocument
      tags:
      - vc-platform
    post:
      consumes:
      - application/json
      description: Get document endpoint
      operationId: get-document
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.GetDocumentRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.GetDocumentReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: GetDocument
      tags:
      - vc-platform
  /document/collect_id:
    post:
      consumes:
      - application/json
      description: Get one document with collect id
      operationId: get-document-collect-id
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.GetDocumentCollectIDRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.GetDocumentCollectIDReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: GetDocumentByCollectID
      tags:
      - vc-platform
  /document/identity:
    delete:
      consumes:
      - application/json
      description: Delete identity to document endpoint
      operationId: delete-document-identity
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.DeleteDocumentIdentityRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: DeleteDocumentIdentity
      tags:
      - vc-platform
    put:
      consumes:
      - application/json
      description: Adding array of identities to one document
      operationId: add-document-identity
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.AddDocumentIdentityRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: AddDocumentIdentity
      tags:
      - vc-platform
  /document/list:
    post:
      consumes:
      - application/json
      description: List documents for an identity
      operationId: document-list
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.DocumentListRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.DocumentListReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: DocumentList
      tags:
      - vc-platform
  /document/revoke:
    post:
      consumes:
      - application/json
      description: Revoke one document
      operationId: revoke-document
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.RevokeDocumentRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: RevokeDocument
      tags:
      - vc-platform
  /identity/mapping:
    post:
      consumes:
      - application/json
      description: Identity mapping endpoint
      operationId: identity-mapping
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.IdentityMappingRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.IdentityMappingReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: IdentityMapping
      tags:
      - vc-platform
  /notification:
    post:
      consumes:
      - application/json
      description: notification endpoint
      operationId: generic-notification
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.NotificationRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.NotificationReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: Notification
      tags:
      - vc-platform
  /revoke:
    post:
      consumes:
      - application/json
      description: Revoke endpoint
      operationId: generic-revoke
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/apiv1.RevokeRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
          schema:
            $ref: '#/definitions/apiv1.RevokeReply'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: Revoke
      tags:
      - vc-platform
  /upload:
    post:
      consumes:
      - application/json
      description: Upload endpoint
      operationId: generic-upload
      parameters:
      - description: ' '
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/vcclient.UploadRequest'
      produces:
      - application/json
      responses:
        "200":
          description: Success
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/helpers.ErrorResponse'
      summary: Upload
      tags:
      - vc-platform
swagger: "2.0"
