Authentication
Manage user accounts, authentication tokens, and user profiles.
Authentication
Manage user accounts, authentication tokens, and user profiles.
Sign Up
POST /auth/signup
Create a new user account with Suble.io. This endpoint registers a new user and immediately returns authentication tokens for seamless onboarding.
ℹ️ Regional Availability: Currently available in Denmark (DK), Norway (NO), Sweden (SE), and Finland (FI).
Request Body
Name | Type | Description |
---|---|---|
fullname | string | Full name of the user |
string | Valid email address for the account | |
password | string | Secure password (minimum requirements apply) |
country | string | Country code (DK, NO, SE, FI) |
language | string | Optional. Preferred language (defaults to "da") |
Example Request:
{
"fullname": "John Doe",
"email": "john@example.com",
"password": "SecurePassword123!",
"country": "DK",
"language": "en"
}
Response
200 - Success
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
400 - Bad Request
{
"error": "Invalid fullname, email, password or country"
}
Log In
POST /auth/login
Authenticate an existing user and obtain access tokens for API usage.
Request Body
Name | Type | Description |
---|---|---|
string | User's email address | |
password | string | User's password |
Example Request:
{
"email": "john@example.com",
"password": "SecurePassword123!"
}
Response
200 - Success
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
403 - Authentication Failed
{
"error": "Invalid email or password."
}
Refresh Token
POST /auth/refresh
Refresh an expired access token using a valid refresh token. Access tokens have a limited lifespan for security purposes.
Request Body
Name | Type | Description |
---|---|---|
refresh_token | string | Valid refresh token from login |
Example Request:
{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Response
200 - Success
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Get User Profile
GET /auth/fetch
Retrieve current user information and account status.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token for authentication |
Response
200 - Success
{
"user": {
"uid": "abc123def456",
"role": "customer",
"email": "john@example.com",
"fullname": "John Doe",
"country": "DK",
"emailVerified": true,
"language": "en",
"customerBillingSetup": 1,
"customerAgreementSetup": 1,
"customerType": "person"
}
}
Update Profile
PUT /auth/profile
Update user profile information such as name and language preferences.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token for authentication |
Request Body
Name | Type | Description |
---|---|---|
fullname | string | Optional. Updated full name |
language | string | Optional. Preferred language code |
Example Request:
{
"fullname": "John Smith",
"language": "en"
}
Response
200 - Success
{
"success": true
}
Password Reset
POST /auth/reset
Request a password reset email or reset password using a reset token.
Request Password Reset
Request Body:
{
"email": "john@example.com"
}
Reset Password with Token
Request Body:
{
"token": "reset_token_from_email",
"password": "NewSecurePassword123!"
}
Response
200 - Success
{
"success": true
}
Log Out
POST /auth/logout
Log out the current user session.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token for authentication |
Response
200 - Success
{
"success": true
}
Related Topics
- Projects - Manage your cloud projects after authentication
- Billing & Profile - Update billing information and view invoices
- API Reference - Error codes and rate limiting information
Suble.io API v2 Documentation
Welcome to the Suble.io API v2 documentation. This comprehensive guide covers all available endpoints for managing your cloud infrastructure, virtual machines, and billing through our modern REST API.
Billing & Profile
Manage your billing information, payment methods, and view usage statistics.