openapi: 3.1.0
info:
  x-metadata:
    tags:
      - Authentication
  version: 1.0.0
  title: Access
  description: >

    This API provides essential endpoints for user information and
    authentication, crucial for accessing and utilising any subsequent
    products. 


    The authentication endpoint ensures secure access to the main API. 


    The user endpoints return comprehensive details about logged-in users within
    the customer's environment and provide higher-level 

    user information. 


    Additionally, the API allows users to view their subscriptions for available
    products and the languages that are supported.


    {% admonition type="info" name="OAS 3.0.4 Trial Availability" %}

    The OAS 3.0.4 version of this API specification is provided for trial
    purposes only. While every effort is made to ensure its accuracy, the OAS
    3.1.0 version is the primary managed and maintained specification and is
    recommended for all integrations and production use.

    {% /admonition %}
tags:
  - name: Authentication
    description: Endpoints for user authentication into the Connect API.
  - name: User Administration
    description: Endpoints for user management.
servers:
  - url: https://connect.sandbox.creditsafe.com/v1
    description: Sandbox server
  - url: https://connect.creditsafe.com/v1
    description: Production server
paths:
  /authenticate:
    post:
      operationId: authenticate
      summary: Authenticate
      security: []
      tags:
        - Authentication
      description: |
        Supply username and password to generate Authentication Token.
          
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectAuthenticationAuthRequest'
        required: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectAuthenticationAuthResponse'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesInvalidToken'
  /access:
    get:
      operationId: subscriptionDetails
      summary: Subscription Details
      tags:
        - User Administration
      description: >-
        Returns the available countries in your subscription - Company Report,
        Director Report, Offline Reports and Monitoring.
      security:
        - bearerToken: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectAuthenticationAccessCountries'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesBadRequest'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesInvalidToken'
  /access/users/active:
    get:
      tags:
        - User Administration
      description: Returns a collection of user details with in the customer
      operationId: ProtectGETActiveCustomerUsers
      summary: List of Active Users
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycProtectGetCustomerUsersDetailsResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesBadRequest'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesInvalidToken'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesAccessForbidden'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ConnectErrorResponsesResourceNotFoundRequest
  /access/users/me:
    get:
      tags:
        - User Administration
      description: Returns the details of logged in user.
      operationId: ProtectGETDetailsOfLoggedInUser
      summary: Logged In User Details
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycProtectGetMyUserDetailsResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesBadRequest'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesInvalidToken'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesAccessForbidden'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ConnectErrorResponsesResourceNotFoundRequest
components:
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This API requires authentication for access to protected endpoints.
        Authentication is performed by providing a valid JWT token in the
        `Authorization` header of each request.
  schemas:
    ConnectAuthenticationAuthRequest:
      type: object
      properties:
        username:
          type: string
          description: Credentials assigned upon sign up
          example: username@domain.com
        password:
          type: string
          example: ^1gHySRA56aj>tf421o
    ConnectAuthenticationAuthResponse:
      type: object
      properties:
        token:
          type: string
          description: Authentication Token
          example: >-
            eyJhbGciOiJSUzI1NiIs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sesInvalidToken:
      type: object
      properties:
        error:
          type: string
      description: >-
        401 - Authorization Token has either expired or is not a valid Connect
        Token
    ConnectAuthenticationAccessCountries:
      type: object
      properties:
        correlationId:
          type: string
        countryAccess:
          type: object
          properties:
            creditsafeConnectOnlineReports:
              type: array
              description: Country usage for Company Reports service
              items:
                type: object
                properties:
                  countryName:
                    type: string
                  templateName:
                    type: string
                    description: Company Report template. Full reports are default
                  countryIso2:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectOfflineReports:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  countryIso2:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectMonitoring:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectDirectorReports:
              type: array
              items:
                type: object
                properties:
                  countryName:
                    type: string
                  countryIso2:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectImageDocuments:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  countryIso2:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectBankValidation:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
            creditsafeConnectBankVerification:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  startDate:
                    type: string
                    description: Date of when the service was enabled
                  expireDate:
                    type: string
                    description: Date of when the service will expire
                  paid:
                    type: integer
                    description: Measure of total usage available in the service
                  used:
                    type: integer
                    description: Service usage
    ConnectErrorResponsesBadRequest:
      type: object
      description: Bad Request
      properties:
        correlationId:
          type: string
          description: A unique ID assigned to this request.
        message:
          type: string
        details:
          type: string
          description: Provides further information on why the request was rejected
    KycProtectGetCustomerUsersDetailsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              firstName:
                type: string
                description: First name of the user.
                example: connect
              surname:
                type: string
                description: Surname name of the user.
                example: connect
              userId:
                type: integer
                description: Id of the user.
                format: int32
                example: 101534481
        totalSize:
          type: integer
          format: int64
    ConnectErrorResponsesAccessForbidden:
      type: object
      description: 403 - Access Forbidden
      properties:
        message:
          type: string
          example: Access forbidden
    ConnectErrorResponsesResourceNotFoundRequest:
      type: object
      description: 404 - Not Found
      properties:
        correlationId:
          type: string
          description: A unique ID assigned to this request.
          format: uuid
        message:
          type: string
        details:
          type: string
          description: Provides further information on why the request was rejected
    KycProtectGetMyUserDetailsResponse:
      type: object
      properties:
        username:
          type: string
          description: The name of the user.
          example: Raj
        emailAddress:
          type: string
          description: The email address of the user.
          example: connectm1@mailinator.com
        owningEntity:
          type: string
          description: Owning entity of the user.
          example: CSUS
        defaultLanguage:
          type: string
          description: user default language.
          example: EN
        primaryContact:
          type: object
          properties:
            title:
              type: string
              description: Title of the user primary contact.
              example: ''
            firstName:
              type: string
              description: firstName of the user primary contact.
              example: ''
            surname:
              type: string
              description: surname of the user primary contact.
              example: ''
        ietfLanguage:
          type: string
          description: user default language.
          example: en-GB
        countryCode:
          type: string
          description: country code of the user.
          example: en-GB
        isActive:
          type: string
          description: status of the user.
          example: true
        correlationId:
          type: string
          description: A unique ID assigned to this request.
          example: 23921650-c073-11ea-860f-06bc8182190e
security:
  - bearerToken: []
