TuCloudAPI addadminuser: Difference between revisions
Appearance
API docs (generated from func=help) — add #48 adminusers + #52 pbxconfig |
API docs (generated from func=help) — #48 rescoped to per-PBX |
||
| Line 1: | Line 1: | ||
''TuCloudAPI function to manage tucloud (PBX) services. Available to: '''SuperRoot, Operator'''.'' | ''TuCloudAPI function to manage tucloud (PBX) services. Available to: '''SuperRoot, Operator, Client'''.'' | ||
== Description == | == Description == | ||
Create a portal admin user. login is the PK (conflict on duplicate). password is required and stored as md5(plaintext) | Create a portal admin user in THIS PBX. login is the PK (conflict on duplicate — login is globally unique). password is required and stored as md5(plaintext). email is required (max 64, valid format). active/priv_admin are 0/1. tucloudpbx_id and root are set server-side (this PBX + its root) — they are NOT accepted from the client. Requires a non-readonly ukey. | ||
== Call == | == Call == | ||
| Line 11: | Line 11: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
! Parameter !! Type !! Required !! Default !! Meaning | ! Parameter !! Type !! Required !! Default !! Meaning | ||
|- | |||
| <code>pbx</code> || string || Yes || — || TuCloud PBX NAME (e.g. tucall). The (ukey, pbx) pair is the tenant boundary; the server verifies the ukey owns this PBX and scopes every admin user to it. | |||
|- | |- | ||
| <code>login</code> || string || Yes || — || Admin login (PK, email-style, max 255). | | <code>login</code> || string || Yes || — || Admin login (PK, email-style, max 255). | ||
|- | |- | ||
| <code>password</code> || string || Yes || — || Plaintext password (stored as unsalted MD5). | | <code>password</code> || string || Yes || — || Plaintext password (stored as unsalted MD5). | ||
|- | |- | ||
| <code>email</code> || string || Yes || — || Email (required, max 64, valid format). | | <code>email</code> || string || Yes || — || Email (required, max 64, valid format). | ||
|- | |- | ||
| <code>name</code> || string || No || — || Display name. | | <code>name</code> || string || No || — || Display name. | ||
| Line 33: | Line 31: | ||
|} | |} | ||
== Example == | == Example == | ||
<nowiki>https://tucloudapi.7kas.com:9087/tucloud?func=addadminuser&ukey=KEY&login=a@x.com&password=secret& | <nowiki>https://tucloudapi.7kas.com:9087/tucloud?func=addadminuser&ukey=KEY&pbx=tucall&login=a@x.com&password=secret&email=a@x.com</nowiki> | ||
== Response == | == Response == | ||
| Line 40: | Line 38: | ||
---- | ---- | ||
Back to [[TuCloudAPI]] | Back to [[TuCloudAPI]] | ||
[[Category:TuCloudAPI SuperRoot]][[Category:TuCloudAPI Operator]][[Category:TuCloudAPI]] | [[Category:TuCloudAPI SuperRoot]][[Category:TuCloudAPI Operator]][[Category:TuCloudAPI Client]][[Category:TuCloudAPI]] | ||
Revision as of 04:50, 2 August 2026
TuCloudAPI function to manage tucloud (PBX) services. Available to: SuperRoot, Operator, Client.
Description
Create a portal admin user in THIS PBX. login is the PK (conflict on duplicate — login is globally unique). password is required and stored as md5(plaintext). email is required (max 64, valid format). active/priv_admin are 0/1. tucloudpbx_id and root are set server-side (this PBX + its root) — they are NOT accepted from the client. Requires a non-readonly ukey.
Call
GET https://tucloudapi.7kas.com:9087/tucloud?func=addadminuser&ukey=YOUR_KEY
Requires the ukey parameter.
Parameters
| Parameter | Type | Required | Default | Meaning |
|---|---|---|---|---|
pbx |
string | Yes | — | TuCloud PBX NAME (e.g. tucall). The (ukey, pbx) pair is the tenant boundary; the server verifies the ukey owns this PBX and scopes every admin user to it. |
login |
string | Yes | — | Admin login (PK, email-style, max 255). |
password |
string | Yes | — | Plaintext password (stored as unsalted MD5). |
email |
string | Yes | — | Email (required, max 64, valid format). |
name |
string | No | — | Display name. |
active |
integer | No | 1 |
1 = active, 0 = disabled. |
priv_admin |
integer | No | 0 |
1 = super-admin flag. |
role |
string | No | — | Free-text role label. |
phone |
string | No | — | Phone. |
Example
https://tucloudapi.7kas.com:9087/tucloud?func=addadminuser&ukey=KEY&pbx=tucall&login=a@x.com&password=secret&email=a@x.com
Response
{ok, user:{...}} or {ok:false,code:conflict|invalid_param}.
Back to TuCloudAPI