Jump to content

TuCloudAPI: Difference between revisions

From Wiki 7Kas
TuCloudAPI reference (regenerated: + simulatecall)
getpbxs: account-scoped selector (all roles)
Line 21: Line 21:
* [[TuCloudAPI getappsrecords]] — List this PBX's selectable records for an app (the record picker), via the tenant-scoped lookup function.
* [[TuCloudAPI getappsrecords]] — List this PBX's selectable records for an app (the record picker), via the tenant-scoped lookup function.
* [[TuCloudAPI getactiondata]] — List the selectable value options for an action (the value picker), for select/checkbox action types, via the tenant-scoped lookup function.
* [[TuCloudAPI getactiondata]] — List the selectable value options for an action (the value picker), for select/checkbox action types, via the tenant-scoped lookup function.
* [[TuCloudAPI getpbxs]] — List the PBXs the calling ukey may manage (post-login selector; show only if >1).
* [[TuCloudAPI getpbxs]] — List the PBXs assigned to the calling ukey's account (post-login selector; show only if >1).
* [[TuCloudAPI addtask]] — Create a scheduled task (status forced 0).
* [[TuCloudAPI addtask]] — Create a scheduled task (status forced 0).
* [[TuCloudAPI updatetask]] — Edit a task (does not change status).
* [[TuCloudAPI updatetask]] — Edit a task (does not change status).

Revision as of 18:48, 1 August 2026

{{{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.