Authentication
Log in with username
The sign-in endpoint used by the mobile app: exchanges username + password (+ two-factor code) for a session token starting with xk_. The token lives API_TOKEN_DAYS days (default 90). For server-to-server integrations use an API key from the Developers page or OAuth instead.
Authorization
No authentication required.
Body application/json
usernamestringrequiredUsername.
passwordstringrequiredPassword.
otpstringoptional6-digit code when two-factor auth is on (the first request returns
otp_required).devicestringoptionalDevice name shown in the session list.
Errors
| HTTP | error | Meaning |
|---|---|---|
401 | credentials | Wrong username or password. |
401 | otp_required | Two-factor code required (`otp`). |
401 | otp_invalid | Wrong or expired two-factor code. |
403 | ip | Access from this network is not allowed (IP restriction). |
403 | license | The licence expired — admins only. |
429 | locked | Too many failed sign-ins — wait 60 s. |
Request
curl -X POST https://ornek.solk.app/api/v1/login \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "1234",
"device": "iPhone 15 · Solk"
}'const res = await fetch("https://ornek.solk.app/api/v1/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"username": "admin",
"password": "1234",
"device": "iPhone 15 · Solk"
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://ornek.solk.app/api/v1/login",
json={
"username": "admin",
"password": "1234",
"device": "iPhone 15 · Solk"
},
)
print(r.json())Response
{
"app": {
"accent": "#0f3a44",
"accent_dark": "#0b2b33",
"company": "Örnek Kimya",
"currencies": [
"EUR"
],
"currency_base": "EUR",
"currency_symbol": "€",
"logo": "",
"name": "Solk CRM",
"opp_lifetime_days": 180,
"site_url": "https://ornek.solk.app",
"stage_sla": {
"Expect to Close": 15,
"Negotiation": 30,
"Present Solution": 60,
"Qualify": 30,
"Viable": 60
},
"ticket_sla_hours": {
"Acil": 4,
"Düşük": 168,
"Normal": 72,
"Yüksek": 24
},
"unit_default": "kg",
"units": [
"kg"
],
"version": "v22"
},
"license": {
"blocked": false,
"customer": "Örnek Kimya",
"days_left": null,
"end": null,
"label": "Deneme modu",
"modules": [
"calendar"
],
"no": null,
"state": "trial"
},
"ok": true,
"token": "xk_1dcb806508e33cee8d728d9baafc6eee23b6e2cb16da8afd",
"user": {
"email": "deniz@ornekkimya.com.tr",
"full_name": "Deniz Aksoy",
"id": 1,
"modules": [
"calendar"
],
"role": "admin",
"role_label": "Yönetici",
"username": "admin"
},
"weak_password": true
}Example responses were captured from a v22 installation running sample data; lists are shortened to two items.