Jump to content

TuCloudAPI

From Wiki 7Kas
Revision as of 18:48, 1 August 2026 by Maintenance script (talk | contribs) (getpbxs: account-scoped selector (all roles))
{{{1}}}

Overview

TuCloudAPI is the REST API to manage tucloud (the multi-tenant PBX, a.k.a. futurepbx). HTTPS, GET, JSON. Base URL:

https://tucloudapi.7kas.com:9087/tucloud?func=NAME&ukey=YOUR_KEY&pbx=PBX_NAME

Authentication & tenant

Every call needs an API key (ukey). The tasks functions also need pbx — the PBX name (e.g. tucall). The (ukey, pbx) pair is the tenant boundary: the server resolves the PBX name to its id and verifies the key owns it (SuperRoot any PBX; Operator its own root; Client its own account). It never trusts a numeric tenant from the caller.

Response format

Always HTTP 200. The tasks functions always return a JSON envelope: success {"ok":true, ...}, empty {"ok":true,"rows":[]}, error {"ok":false,"code":...,"message":...} (codes: missing_pbx, unknown_pbx, forbidden, invalid_param, not_found, db_error, server_busy). IDs are exposed as _id. Base/legacy functions return their data object directly, or {} on error/empty.

Functions

Scheduled tasks (Tareas programadas)

Tucloud PBX

Meta / discovery

  • TuCloudAPI help — Lists the API functions available to the role of the calling ukey, with each function's description, parameters (meaning, optional/default), an example call and the response format.

Diagnostics

Administration

Account management (inherited)

simulator

  • TuCloudAPI simulatecall — Simulate how a call routes (inbound DID / outbound / internal) WITHOUT placing a real call, returning the ordered decision trace (flujo).

Related

Full technical reference (architecture, auth model, side effects): see the project repo doc/TUCLOUDAPI_REFERENCE.md. Scheduled-tasks engine: the 6 tucloud_pbx_tasks* tables + the .231 crontab trigger.