Jump to content

TuCloudAPI: Difference between revisions

From Wiki 7Kas
TuCloudAPI reference (generated from func=help): authrequest relays login_code, authpoll names denied
TuCloudAPI reference (generated from func=help; ringinuse 2026-10-31)
Line 145: Line 145:
* [[TuCloudAPI updateprofile]] — Rename a profile (description).
* [[TuCloudAPI updateprofile]] — Rename a profile (description).
* [[TuCloudAPI deleteprofile]] — Delete a profile.
* [[TuCloudAPI deleteprofile]] — Delete a profile.
* [[TuCloudAPI setprofileapps]] — Bulk-save a profile's FULL permission matrix in one call (the primary matrix write).
* [[TuCloudAPI getsections]] — The catalog of portal sections (login v2, 2026-10-31): one row per section of the new web, in sidebar order, from the NEW table tucloud_sec_sections (24 rows; pbx_config is the PBX administrator's and has no row).
* [[TuCloudAPI setprofileapp]] — Set ONE app's permissions for a profile.
* [[TuCloudAPI getprofilesections]] — One profile's section access (login v2): every catalog section with access Y/N, from the NEW table tucloud_sec_groups_sections; a section without a row answers N.
* [[TuCloudAPI setprofilesections]] — FULL replace of one profile's section access (login v2; the «mantenimiento de accesos de los grupos» the operator asked for on 2026-10-31).
* [[TuCloudAPI setprofileapps]] — RETIRED 2026-10-31 (operator: the legacy matrix is never altered again).
* [[TuCloudAPI setprofileapp]] — RETIRED 2026-10-31 (operator: the legacy matrix is never altered again).
* [[TuCloudAPI setuserprofiles]] — Full-replace an admin user's profile membership (this PBX only).
* [[TuCloudAPI setuserprofiles]] — Full-replace an admin user's profile membership (this PBX only).
=== Call detail records (CDR) ===
=== Call detail records (CDR) ===
Line 195: Line 198:
* [[TuCloudAPI authrequest]] — Ask for a magic-link e-mail.
* [[TuCloudAPI authrequest]] — Ask for a magic-link e-mail.
* [[TuCloudAPI authpoll]] — Has the user authorized the magic link? PUBLIC, like authrequest.
* [[TuCloudAPI authpoll]] — Has the user authorized the magic link? PUBLIC, like authrequest.
* [[TuCloudAPI authchallenge]] — A proof-of-work captcha challenge (ALTCHA protocol, SHA-256).
* [[TuCloudAPI authlogin]] — The password door.
* [[TuCloudAPI authwhoami]] — The current session context, and it refreshes the idle timer.
* [[TuCloudAPI authwhoami]] — The current session context, and it refreshes the idle timer.
* [[TuCloudAPI authlogout]] — Destroy the session and clear the cookie.
* [[TuCloudAPI authlogout]] — Destroy the session and clear the cookie.

Revision as of 11:48, 31 October 2026

ℹ New here? Start with the self-discovery endpoint. This reference is generated from func=help, so it never drifts.

Overview

TuCloudAPI is the REST API to manage FuturePBX (the multi-tenant cloud PBX). HTTPS + JSON, GET or POST (parameters form-urlencoded; audio uploads POST the file as the body). 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). Every PBX-scoped function also needs 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 that the key's OWN account owns it — for every role, SuperRoot included. A PBX that does not exist and one the key does not own both answer forbidden. It never trusts a numeric tenant from the caller.

Response format

Always HTTP 200. Every PBX-scoped function always returns a JSON envelope: success {"ok":true, ...}, empty {"ok":true,"rows":[]}, error {"ok":false,"code":...,"message":...} (common codes: missing_pbx, forbidden, invalid_param, not_found, conflict, in_use, db_error, server_busy). IDs are exposed as _id. A missing or invalid ukey answers a bare {} and nothing else. The legacy account functions return their data object directly, {} when there is nothing.

Functions

Dashboard (landing counts)

Extensions (Extensiones)

CLIs / DIDs (Numeracion)

Routes (Rutas)

Blacklist (inbound intercept)

Contacts (Agenda)

Calendar (date overrides)

Ring groups (Grupos)

Locutions / IVR (Locuciones)

Music on hold (MOH)

Schedules (Horarios)

Outbound routing (Rutas de salida)

Phonebooks (Agendas)

Call queues / ACD (Colas)

Agents / queue members (Agentes)

Portal admin users (Usuarios)

PBX settings (Configuracion)

Security profiles / ACL (Perfiles)

Call detail records (CDR)

  • TuCloudAPI getcdr — List a period of this PBX's call detail records (Registro de llamadas), newest first.
  • TuCloudAPI getcdrlookups — CDR form pickers: the selectable years + the result (disposition) label set.

Reports / statistics (Informes)

  • TuCloudAPI getreports — Call-volume statistics (Informes / Estadisticas de Llamadas) for a month — VOLUME ONLY, no prices.

AI assistant (Asistente IA)

Scheduled tasks (Tareas programadas)

Call simulator

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

Audio files

  • TuCloudAPI getaudio — General-purpose audio file server (not only for the simulator): serve a locution or music-on-hold audio file base64-encoded (audio/wav) — for hover-preview, players, downloads, etc.

FuturePBX

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)

auth

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.