cURL
curl --request POST \
--url https://www.wassly.com/api/login \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"email": "hatem.gaballah@gmail.com",
"password": "abc123$"
}
'import requests
url = "https://www.wassly.com/api/login"
payload = {
"email": "hatem.gaballah@gmail.com",
"password": "abc123$"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'hatem.gaballah@gmail.com', password: 'abc123$'})
};
fetch('https://www.wassly.com/api/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.wassly.com/api/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'hatem.gaballah@gmail.com',
'password' => 'abc123$'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.wassly.com/api/login"
payload := strings.NewReader("{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.wassly.com/api/login")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.wassly.com/api/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Login Successfully",
"data": {
"id": 2,
"name": "User Name",
"role_id": 3,
"client_id": 1,
"phone": "+{mobile_number}",
"email": "user@example.com",
"location": "",
"profile_image": "https://www.wassly.com/public/images/20251216152039image_163x116_user_436.png",
"openai_api_key": null,
"token": "{token}"
}
}{
"success": false,
"message": "Invalid Credentials",
"data": []
}Authentication
Login
POST
/
api
/
login
cURL
curl --request POST \
--url https://www.wassly.com/api/login \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"email": "hatem.gaballah@gmail.com",
"password": "abc123$"
}
'import requests
url = "https://www.wassly.com/api/login"
payload = {
"email": "hatem.gaballah@gmail.com",
"password": "abc123$"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'hatem.gaballah@gmail.com', password: 'abc123$'})
};
fetch('https://www.wassly.com/api/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.wassly.com/api/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'hatem.gaballah@gmail.com',
'password' => 'abc123$'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.wassly.com/api/login"
payload := strings.NewReader("{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.wassly.com/api/login")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.wassly.com/api/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"hatem.gaballah@gmail.com\",\n \"password\": \"abc123$\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Login Successfully",
"data": {
"id": 2,
"name": "User Name",
"role_id": 3,
"client_id": 1,
"phone": "+{mobile_number}",
"email": "user@example.com",
"location": "",
"profile_image": "https://www.wassly.com/public/images/20251216152039image_163x116_user_436.png",
"openai_api_key": null,
"token": "{token}"
}
}{
"success": false,
"message": "Invalid Credentials",
"data": []
}Overview
This endpoint authenticates users and initiates a login session. It validates user credentials (email and password) and returns authentication tokens or session information upon successful authentication.Request Details
Required Fields
-
email (string, required): The user’s registered email address
- Must be a valid email format
-
Example:
user@example.com
-
password (string, required): The user’s account password
- Should meet the application’s password requirements
- Transmitted securely over HTTPS
Request Headers
-
Content-Type: application/json- Indicates JSON payload -
Accept: application/json- Expects JSON response -
apikey: xxx- Can be generated from the admin dashboard
Expected Response
Success Response (200 OK)
Returns authentication credentials and user information:- Authentication token(s) for subsequent API requests
- User profile data
- Session expiration details
Error Responses
- 400 Bad Request: Missing or invalid email/password format
- 401 Unauthorized: Invalid credentials
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server-side error
Authentication Flow
- User submits email and password via POST request
- Server validates credentials against stored user data
-
Upon successful validation:
- Authentication token is generated
- Session is created
- Token and user data are returned
- Client stores token for authenticated requests
- Token is included in subsequent API calls (typically in Authorization header)
Usage Notes & Best Practices
- Security: Always use HTTPS in production to protect credentials in transit
- Token Storage: Store authentication tokens securely (e.g., httpOnly cookies, secure storage)
- Error Handling: Never expose detailed error messages that could aid attackers
- Password Requirements: Ensure passwords meet security standards (length, complexity)
- Session Management: Implement proper logout functionality to invalidate tokens
Example Usage
POST {{baseUrl}}/api/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "securePassword123"
}

