{
  "openapi": "3.1.0",
  "info": {
    "title": "Connect Authenticate",
    "x-metadata": {
      "status": "published",
      "tags": [
        "Sweden"
      ]
    },
    "description": "CONNECT Authenticate is a global authentication service that generates Bearer JWT tokens  for accessing Creditsafe Sweden REST APIs. This includes GetDataUnits REST, DateCheck  Consumer REST, DateCheck Company REST, GetSignatory v2 REST, GetData REST, and SPAR  Consumer search v2 REST.",
    "version": "1.0.0",
    "contact": {
      "name": "Creditsafe Integration Team",
      "email": "integration@creditsafe.se"
    }
  },
  "servers": [
    {
      "url": "https://connect.creditsafe.com",
      "description": "CONNECT Production server (used for all authentication)"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Authentication endpoint to generate Bearer/JWT tokens"
    }
  ],
  "paths": {
    "/v1/authenticate": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authenticate",
        "summary": "Generate authentication token",
        "security": [],
        "description": "Endpoint to generate a Bearer JWT Authentication Token using your username (User Key)  and password. The token is required for accessing all Creditsafe Sweden REST APIs including  GetDataUnits, DateCheck Consumer, DateCheck Company, GetSignatory v2, GetData, and SPAR  Consumer search v2. Tokens are valid for one hour and multiple valid tokens can exist  simultaneously.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRequest"
              },
              "example": {
                "username": "myUsername",
                "password": "myS3cretP@ssw0rd999!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful authentication - Returns JWT token valid for 1 hour",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                },
                "example": {
                  "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing or invalid request parameters",
            "content": {
              "text/plain": {
                "example": ""
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid credentials",
            "content": {
              "text/plain": {
                "example": "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."
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded. Maximum 5 identical invalid  requests within 2 minutes, or total threshold exceeded within 5 minutes.",
            "content": {
              "text/plain": {
                "example": {
                  "error": {
                    "code": "500",
                    "text": "Internal server error",
                    "detail": "An unexpected error occurred. Please try again later."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthRequest": {
        "type": "object",
        "description": "Authentication request body",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string",
            "maxLength": 30,
            "description": "Your User Key as provided by Creditsafe (case-sensitive).  Note: This is NOT the email address used for website login.",
            "example": "myUsername"
          },
          "password": {
            "type": "string",
            "format": "password",
            "maxLength": 30,
            "description": "Your password (case-sensitive)",
            "example": "myS3cretP@ssw0rd999!"
          }
        }
      },
      "AuthResponse": {
        "type": "object",
        "description": "Authentication response containing JWT token",
        "properties": {
          "token": {
            "type": "string",
            "description": "JWT Bearer token to be included in the Authorization header for all subsequent API requests. Valid for 1 hour from generation. Multiple  valid tokens can exist simultaneously.",
            "example": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkQ3RTRBNzMxRjMyQjYwQzM4QTQxMkREMUVCNEJBOTg4IiwidHlwIjoiYXQrand0In0.eyJpc3MiOiJodHRwczovL3NlLXdlYnNlcnZpY2UuYXBwcy5jcmVkaXRzYWZlLmNvbS8iLCJuYmYiOjE3MzA5NzMyNzksImlhdCI6MTczMDk3MzI3OSwiZXhwIjoxNzMwOTc2ODc5LCJhdWQiOiJDcmVkaXRzYWZlU3dlZGlzaEFQSSIsInNjb3BlIjpbImRhdGFjaGVjayIsImNvbXBhbnlnZXRkYXRhIl0sImNsaWVudF9pZCI6InlvdXItdXNlcm5hbWUiLCJqdGkiOiI4RTdBNDk2QTZFQkZCQzQ2OTY0QzRDQTgyMzM3QkU5NiJ9.signature"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Error response for failed requests",
        "properties": {
          "error": {
            "type": "object",
            "description": "Error details",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code identifying the type of error",
                "example": "1"
              },
              "text": {
                "type": "string",
                "description": "Human-readable error message",
                "example": "Invalid credentials"
              },
              "detail": {
                "type": "string",
                "description": "Additional details about the error",
                "example": "The username or password provided is incorrect"
              }
            }
          }
        }
      }
    },
    "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."
      }
    }
  },
  "security": [
    {
      "bearerToken": []
    }
  ]
}