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.

POST/api/v1/login

Authorization

No authentication required.

Body application/json

usernamestringrequired
Username.
passwordstringrequired
Password.
otpstringoptional
6-digit code when two-factor auth is on (the first request returns otp_required).
devicestringoptional
Device name shown in the session list.

Errors

HTTPerrorMeaning
401credentialsWrong username or password.
401otp_requiredTwo-factor code required (`otp`).
401otp_invalidWrong or expired two-factor code.
403ipAccess from this network is not allowed (IP restriction).
403licenseThe licence expired — admins only.
429lockedToo 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"
}'
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.