openapi: 3.1.0
info:
  x-metadata:
    status: published
    tags:
      - Compliance
  version: 1.0.0
  title: Country Risk
  description: >-
    Retrieve country-level AML, ESG, sovereign, and supply chain risk
    indicators, including scores, classifications, and rankings for compliance
    and risk assessment workflows.
tags:
  - name: Authentication
    description: Authentication endpoint to obtain access token for API requests.
  - name: Country Risk
    description: Endpoints for retrieving country risk information.
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/ConnectAuthFailedResponse'
  /compliance/countryRisk/{countryCode}:
    get:
      operationId: complianceCountryRiskCountryCodeGet
      tags:
        - Country Risk
      summary: Return Country Risk Details Of A Given Country
      description: >-
        Returns country risk details for a given country code, including AML,
        ESG, sovereign, and supply chain indicators when data is available.
        Fields that evaluate to `null` in backend processing may be omitted from
        the customer response payload.
      parameters:
        - name: countryCode
          in: path
          required: true
          description: The code of the country.
          schema:
            type: string
      responses:
        '200':
          description: Country risk response for the requested country.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplianceCountryRiskResponse'
              examples:
                standardResponse:
                  summary: Typical single-country response
                  value:
                    correlationId: f563b6bc-549f-4d4a-95bc-c658b407bd2f
                    country:
                      countryCodeIso3: MAF
                      countryCodeIso2: MF
                      countryName: Saint Martin (French part)
                      region: Americas
                    risk:
                      oecdMember: false
                      worldBankClassification: High income
                      countryRiskIndicatorAml:
                        countryRank: 154
                        countryUniverse: 249
                        dataQualityCategorical: Poor
                        dataQualityNumeric: 2
                        euHighRiskFlag: false
                        fatfHighRisk: false
                        fatfIncreasedMonitoring: false
                        riskClassificationCategorical: High
                        riskClassificationNumeric: 4
                        score: 42.86
                      countryRiskIndicatorEsg:
                        dataQualityCategorical: Very Poor
                        countryUniverse: 186
                        dataQualityNumeric: 1
                        riskClassificationCategorical: null
                        score: null
                        countryRank: null
                        riskClassificationNumeric: null
                      countryRiskIndicatorSovereign:
                        dataQualityCategorical: Very Poor
                        dataQualityNumeric: 1
                        countryUniverse: 184
                        riskClassificationCategorical: null
                        score: null
                        countryRank: null
                        riskClassificationNumeric: null
                      countryRiskIndicatorSupplyChainRisk:
                        dataQualityCategorical: Very Poor
                        riskClassificationCategorical: Very Low
                        score: 12.63
                        countryRank: 18
                        countryUniverse: 233
                        dataQualityNumeric: 1
                        riskClassificationNumeric: 1
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesBadRequest'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectErrorResponsesInvalidToken'
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: >-
            eyJhbGciOiJSUzI1NiIsImtpZCI6ImRodTNnNkFtTG5QQXVpOEJSMUFEVnp5ZHBnZyIsInR5cCI6IkpXVCIsIng1dCI6ImRodTNnNkFtTG5QQXVpOEJSMUFEVnp5ZHBnZyJ9.eyJuYmYiOjE1OTU0MTYyMDksImV4cCI6MTU5NTQxOTgwOSwiaXNzIjoiaHR0cHM6Ly9teWxvZ2luLnRlc3QuY3JlZGl0c2FmZS5jb20iLCJhdWQiOlsiaHR0cHM6Ly9teWxvZ2luLnRlc3QuY3JlZGl0c2FmZS5jb20vcmVzb3VyY2VzIiwiY29ubmVjdF9hcGkiLCJ1Ym9fYXBpX2dhdGV3YXkiXSwiY2xpZW50X2lkIjoiY29ubmVjdC5hcGkuY2xpZW50Iiwic3ViIjoiMTAxNTIwMjg1IiwiYXV0aF90aW1lIjoxNTk1NDE2MjA5LCJpZHAiOiJsb2NhbCIsInVzZXJuYW1lIjoiQ29ubmVjdHUxIiwiZW1haWwiOiJDb25uZWN0MUBnbWFpbC5jb20iLCJjdXN0b21lcklkIjoiMTAxNzY0NDA1IiwiY291bnRyeSI6IkMwIiwidXNlclJvbGUiOiJDcm1BZG1pblBsdXMiLCJzYl9jb3VudHJ5IjoiVVMiLCJzY29wZSI6WyJjb25uZWN0X2FwaSIsInVib19hcGlfZ2F0ZXdheSJdLCJhbXIiOlsicHdkIl19.p8kPAlKNB9iWEKiQbfbRXBoLQuBG7NuEDN__A8AQ55CL-gcIwkS1717Af1f9W0uifwIQ6HAZQR_x191LVkvuWD94Zw8zLzzr1ioUIhQny_zYuAS3G6EFNaTHh_mvOQ9XVi1FyuIy6YYcYcNLNZurFuITF2w5LuX4YQBjQy3rhEAdRoKcUKbtCClMFaH2dV35jiX2d7BqyhtJ8GeZyJ6yfMfdzznqxlJ4Osf5aasKUy8RYKEpjU2pkCURojoy5_oviGs8X4U9mJWcuajmPF3i5DHkqbhq1Mp0UZrDyoq_0BDStV5xqRgq6aOY8mc45kX7cwY3O2hPeGE7Ak8YtKFbA
    ConnectAuthFailedResponse:
      type: object
      properties:
        message:
          type: string
      example:
        message: >-
          Access denied -  Please check that your username and password are
          correct.  Please be aware that usernames and passwords are case
          sensitive. If the problem persists, please contact your Creditsafe
          account manager.
    ComplianceCountryRiskResponse:
      type: object
      description: >-
        Country risk response for a single country. Nullable fields are shown in
        this schema for completeness, but fields that evaluate to `null` may be
        omitted from runtime API responses.
      properties:
        correlationId:
          type: string
          format: uuid
          description: Correlation ID for request tracing.
        country:
          type: object
          description: Country identity and regional metadata.
          properties:
            region:
              type: string
              description: The region of the country.
            countryName:
              type: string
              description: The name of the country.
            countryCodeIso2:
              type: string
              description: The ISO 2 code of the country.
            countryCodeIso3:
              type: string
              description: The ISO 3 code of the country.
          required:
            - countryCodeIso3
            - countryCodeIso2
            - countryName
            - region
        risk:
          type: object
          description: >-
            Country risk indicators returned by the service. Nullable indicator
            fields are included in the schema model, but may be omitted from
            runtime responses when no value is available.
          properties:
            oecdMember:
              type: boolean
              description: The OECD member status of the country.
            worldBankClassification:
              type: string
              description: The World Bank classification of the country.
            countryRiskIndicatorAml:
              type: object
              description: >-
                Contains AML (Anti-Money Laundering) risk metrics for the
                country.  Includes the AML risk score (0–100), categorical risk
                classification,  global ranking, and data‑quality indicators.
                Values reflect inherent AML  exposure and the strength of
                regulatory and enforcement frameworks.  


                Scores and rankings are provided only where sufficient
                underlying AML data is  available.
              properties:
                countryRank:
                  type: integer
                  nullable: true
                  description: Global ranking where 1 indicates the lowest risk.
                countryUniverse:
                  type: integer
                  nullable: true
                  description: Total number of countries included in this ranking model.
                dataQualityCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical data quality label.
                  enum:
                    - Very Good
                    - Good
                    - Medium
                    - Poor
                    - Very Poor
                    - Not Available
                    - null
                dataQualityNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of data quality (1 best, 5 worst).
                euHighRiskFlag:
                  type: boolean
                  nullable: true
                  description: >-
                    Indicates whether the country is on the EU high-risk
                    third-country list.
                fatfHighRisk:
                  type: boolean
                  nullable: true
                  description: Indicates FATF high-risk jurisdiction status (black list).
                fatfIncreasedMonitoring:
                  type: boolean
                  nullable: true
                  description: Indicates FATF increased monitoring status (grey list).
                riskClassificationCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical risk band.
                  enum:
                    - Very Low
                    - Low
                    - Medium
                    - High
                    - Very High
                    - null
                riskClassificationNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of risk classification.
                score:
                  type: number
                  format: float
                  nullable: true
                  description: Risk score on a 0 to 100 scale.
            countryRiskIndicatorEsg:
              type: object
              description: >-
                Contains ESG (Environmental, Social, and Governance) risk
                metrics for the  country. Includes ESG score, categorical risk
                classification, global ranking,  and data‑quality indicators.  


                Scores and rankings are provided only where sufficient
                underlying ESG data is available.
              properties:
                countryRank:
                  type: integer
                  nullable: true
                  description: Global ranking where 1 indicates the lowest ESG risk.
                countryUniverse:
                  type: integer
                  nullable: true
                  description: Total number of countries included in this ranking model.
                dataQualityCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical data quality label.
                  enum:
                    - Very Good
                    - Good
                    - Medium
                    - Poor
                    - Very Poor
                    - Not Available
                    - null
                dataQualityNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of data quality (1 best, 5 worst).
                riskClassificationCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical ESG risk band.
                  enum:
                    - Very Low
                    - Low
                    - Medium
                    - High
                    - Very High
                    - null
                riskClassificationNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of ESG risk classification.
                score:
                  type: number
                  format: float
                  nullable: true
                  description: ESG score on a 0 to 100 scale.
            countryRiskIndicatorSovereign:
              type: object
              description: >-
                Contains sovereign‑risk metrics assessing a country’s economic
                and financial  stability and its ability to meet debt
                obligations. Includes sovereign risk  score, categorical
                classification, global ranking, and data‑quality measures. 


                Scores and rankings are provided only where sufficient
                underlying sovereign  data is available.
              properties:
                countryRank:
                  type: integer
                  nullable: true
                  description: Global ranking where 1 indicates the lowest sovereign risk.
                countryUniverse:
                  type: integer
                  nullable: true
                  description: Total number of countries included in this ranking model.
                dataQualityCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical data quality label.
                  enum:
                    - Very Good
                    - Good
                    - Medium
                    - Poor
                    - Very Poor
                    - Not Available
                    - null
                dataQualityNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of data quality (1 best, 5 worst).
                riskClassificationCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical sovereign risk band.
                  enum:
                    - Very Low
                    - Low
                    - Medium
                    - High
                    - Very High
                    - null
                riskClassificationNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of sovereign risk classification.
                score:
                  type: number
                  format: float
                  nullable: true
                  description: Sovereign score on a 0 to 100 scale.
            countryRiskIndicatorSupplyChainRisk:
              type: object
              description: >-
                Contains supply‑chain‑related country‑risk metrics, including
                the overall  supply chain risk score, categorical
                classification, global ranking, and  data‑quality indicators.
                The score reflects exposure to vulnerabilities such  as
                governance, environmental conditions, and labour‑related
                risks.  


                Scores and rankings are provided only where sufficient
                underlying supply chain data  is available.
              properties:
                countryRank:
                  type: integer
                  nullable: true
                  description: >-
                    Global ranking where 1 indicates the lowest supply chain
                    risk.
                countryUniverse:
                  type: integer
                  nullable: true
                  description: Total number of countries included in this ranking model.
                dataQualityCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical data quality label.
                  enum:
                    - Very Good
                    - Good
                    - Medium
                    - Poor
                    - Very Poor
                    - Not Available
                    - null
                dataQualityNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of data quality (1 best, 5 worst).
                riskClassificationCategorical:
                  type:
                    - string
                    - 'null'
                  description: Categorical supply chain risk band.
                  enum:
                    - Very Low
                    - Low
                    - Medium
                    - High
                    - Very High
                    - null
                riskClassificationNumeric:
                  type: integer
                  nullable: true
                  description: Numeric representation of supply chain risk classification.
                score:
                  type: number
                  format: float
                  nullable: true
                  description: Supply chain risk score on a 0 to 100 scale.
          required:
            - oecdMember
            - worldBankClassification
      required:
        - correlationId
        - country
        - risk
      example:
        correlationId: f563b6bc-549f-4d4a-95bc-c658b407bd2f
        country:
          countryCodeIso3: MAF
          countryCodeIso2: MF
          countryName: Saint Martin (French part)
          region: Americas
        risk:
          oecdMember: false
          worldBankClassification: High income
          countryRiskIndicatorAml:
            countryRank: 154
            countryUniverse: 249
            dataQualityCategorical: Poor
            dataQualityNumeric: 2
            euHighRiskFlag: false
            fatfHighRisk: false
            fatfIncreasedMonitoring: false
            riskClassificationCategorical: High
            riskClassificationNumeric: 4
            score: 42.86
          countryRiskIndicatorEsg:
            dataQualityCategorical: Very Poor
            countryUniverse: 186
            dataQualityNumeric: 1
            riskClassificationCategorical: null
            score: null
            countryRank: null
            riskClassificationNumeric: null
          countryRiskIndicatorSovereign:
            dataQualityCategorical: Very Poor
            dataQualityNumeric: 1
            countryUniverse: 184
            riskClassificationCategorical: null
            score: null
            countryRank: null
            riskClassificationNumeric: null
          countryRiskIndicatorSupplyChainRisk:
            dataQualityCategorical: Very Poor
            riskClassificationCategorical: Very Low
            score: 12.63
            countryRank: 18
            countryUniverse: 233
            dataQualityNumeric: 1
            riskClassificationNumeric: 1
    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
    ConnectErrorResponsesInvalidToken:
      type: object
      properties:
        error:
          type: string
      description: >-
        401 - Authorization Token has either expired or is not a valid Connect
        Token
security:
  - bearerToken: []
