Login
curl --request POST \
--url https://api-staging.genuka.com/2023-11/developer/auth/login \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "password"
}
'import requests
url = "https://api-staging.genuka.com/2023-11/developer/auth/login"
payload = {
"email": "[email protected]",
"password": "password"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', password: 'password'})
};
fetch('https://api-staging.genuka.com/2023-11/developer/auth/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://api-staging.genuka.com/2023-11/developer/auth/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' => '[email protected]',
'password' => 'password'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api-staging.genuka.com/2023-11/developer/auth/login"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-staging.genuka.com/2023-11/developer/auth/login")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.genuka.com/2023-11/developer/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}"
response = http.request(request)
puts response.read_bodyLogin
Login
Login
curl --request POST \
--url https://api-staging.genuka.com/2023-11/developer/auth/login \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "password"
}
'import requests
url = "https://api-staging.genuka.com/2023-11/developer/auth/login"
payload = {
"email": "[email protected]",
"password": "password"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', password: 'password'})
};
fetch('https://api-staging.genuka.com/2023-11/developer/auth/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://api-staging.genuka.com/2023-11/developer/auth/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' => '[email protected]',
'password' => 'password'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api-staging.genuka.com/2023-11/developer/auth/login"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-staging.genuka.com/2023-11/developer/auth/login")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.genuka.com/2023-11/developer/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}"
response = http.request(request)
puts response.read_bodyOverview
The Login API enables users to authenticate with the Genuka platform using their registered email and password credentials. This endpoint returns access tokens that can be used to make authenticated requests to other Genuka API endpoints.This endpoint authenticates existing users and provides the necessary tokens for accessing protected resources. Users must have a verified account before they can successfully log in.
Use Cases
This API endpoint is typically used for:- User Authentication - Verify user credentials and establish authenticated sessions
- Third-party Integrations - Allow external applications to authenticate Genuka users
- API Access - Obtain tokens required for making authenticated API calls
- Session Management - Initialize user sessions for web applications
Authentication Flow
When a user successfully logs in, the following process occurs:- Credential Validation - Email and password are verified against stored user data
- Token Generation - New access and refresh tokens are created
- Session Initialization - User session data is prepared
- Response Return - Authentication tokens and user information are provided
Security Features
- Password Hashing - Passwords are securely hashed using industry-standard algorithms
- Rate Limiting - Login attempts are limited to 5 attempts per IP address per 15 minutes
- Token Security - Access tokens have limited lifespan and are cryptographically signed
- Secure Transmission - All login requests must be made over HTTPS
Token Information
Upon successful authentication, you’ll receive:- Access Token - Short-lived token (1 hour) for API authentication
- Refresh Token - Long-lived token (30 days) for obtaining new access tokens
- Token Type - Always “Bearer” for use in Authorization headers
- Expires In - Token expiration time in seconds
Error Handling
Common login errors include:- Invalid Credentials - Incorrect email or password
- Unverified Email - Account exists but email verification is pending
- Account Suspended - Account has been temporarily or permanently disabled
Store authentication tokens securely and never expose them in client-side code. Implement proper token refresh logic to maintain user sessions without requiring frequent re-authentication.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
Example:
"password"
Response
200 - undefined
