TuCloudAPI authlogin
TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.
Description
The password door. PUBLIC. POST with an application/x-www-form-urlencoded body: login is the username -- the PBX administrator's tucloud_pbx.email (matched trimmed, lower-cased) or tucloud_pbx.pbxname (exact case), always with tucloud_pbx.password; or a sec_user's LOGIN or EMAIL column (trimmed, case-insensitive) with its password -- password as typed (never in the URL: refused with invalid_param), captcha optional as in authrequest. Both credential sets are always looked up; the PBX wins when its password matches, else the one active user whose password matches. Success = exactly the authpoll success (Set-Cookie + the context). One failure code, auth_failed, for an unknown e-mail, a wrong password, an inactive user, an ambiguous match and a blocked e-mail alike (10 failures block the e-mail for 10 minutes); rate_limited per IP; captcha_required / captcha_invalid; auth_unavailable when the database could not be asked. OBSOLETE by the operator's decision of 2026-10-31: it stops working on 2027-01-01 ([SERVICE] authlogin_until) and answers auth_retired from then on; the magic link (authrequest / authpoll) is the door that stays.
Call
https://tucloudapi.7kas.com:9087/tucloud?func=authlogin&ukey=YOUR_KEY
GET, or POST with the parameters form-urlencoded in the body. Requires the ukey parameter.
Parameters
| Parameter | Type | Required | Default | Meaning |
|---|---|---|---|---|
login |
string | Yes | — | The username: PBX e-mail or pbxname, or a sec_users login or e-mail. Max 255. |
password |
string | Yes | — | The password, in the POST body only. Max 255. |
captcha |
string | No | — | base64 of the solved authchallenge JSON. |
Example
POST https://tucloudapi.7kas.com:9087/tucloud?func=authlogin (body: login=alguien@example.com&password=...&captcha=...)
Response
{ok, pbx, pbx_id, root, admin_ext_id, identity, is_admin, idle_timeout, identity_kind ("pbx" | "user"), login (the e-mail typed, or the sec_users login), name, priv_admin, profiles [{_id, description}], sections [nav ids the session may use; all 25 for kind pbx]} plus Set-Cookie; {ok:false, code} otherwise.
Back to TuCloudAPI