Authentication
The Multilocale API uses JWT-based authentication. Obtain tokens via login or signup, then include the access token in subsequent requests.
Login
Authenticate with email and password.
POST /api/login
Headers
Authorization: Basic <base64(email:password)>
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}
Example
curl -X POST https://api.multilocale.com/api/login \
-H "Authorization: Basic $(echo -n 'user@example.com:password123' | base64)"
Signup
Create a new account.
POST /api/signup
Headers
Authorization: Basic <base64(email:password)>
Body (optional)
{
"firstName": "John",
"lastName": "Doe",
"language": "en"
}
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "eyJhbGciOiJIUzI1NiIs...",
"newOrganization": true
}
Refresh Token
Access tokens expire. Use the refresh token to get new tokens without re-authenticating.
POST /api/refresh-access-token
Headers
Authorization: Token <base64(refreshToken)>
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}
Using Tokens
Include the access token in the Authorization header for authenticated requests:
Authorization: Token <base64(accessToken)>
Example
curl https://api.multilocale.com/api/projects \
-H "Authorization: Token $(echo -n 'eyJhbGciOiJIUzI1NiIs...' | base64)"
Forgot Password
Request a password reset email.
POST /api/forgot-password
Headers
Authorization: Basic <base64(email)>
Response
{
"email": "user@example.com"
}
Change Password
Change password using a forgot-password token.
POST /api/change-password
Body
{
"newPassword": "newSecurePassword123",
"forgotPasswordToken": "token-from-email"
}
Response
{}