TenkaTenka
Sign in

Tenka Help Center › Developer area › Run a BI dataset (JSON or CSV)

Analytics

Run a BI dataset (JSON or CSV)

GET/api/v1/analitico/{dataset}

Runs a BI dataset with the same governance as the dashboard: the key owner's row rules before any filter, value columns only with See Values, declared row ceiling. Returns JSON or CSV (Power BI and Metabase read it directly).

With formato=csv the response is text/csv (BOM, comma, doubled quotes), not JSON.

Key scope

Any key of the account (read is enough).

Parameters

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer followed by the key. Alternative: X-API-Key header.
datasetpathstringyesDataset key (see the analytics catalog).
formatoquerystringnojson (default) or csv — CSV with BOM, comma, doubled quotes; Power BI and Metabase read it directly.
colunasquerystringnoKeys or labels separated by commas; empty = the dataset columns. Company-created fields (cc_*) only when asked by name; sensitive ones only with See Values.
filtrosquerystringnocampo=valor;campo2>valor2;campo3~contem (also <, >=, <=). Filterable columns only; the rest comes back in ignorados.
agrupamentoquerystringnoText or date column to group by (one row per value, metrics aggregated).
funcaoquerystringnoWith agrupamento: SOMA (default) | MEDIA | CONTAGEM | MAIOR | MENOR | MEDIANA.
fontequerystringnosnapshot = the daily picture (instant, with atualizadoEm; only without row rule, filter and grouping — otherwise the API answers live and says so in fonte).
atualizarquerystringno1 with fonte=snapshot: refreshes the picture before answering.
paginaqueryintegernoPage (starts at 1) over the queried set.
tamanhoqueryintegernoRows per page, up to the ceiling (default = the ceiling).

Response fields

NameTypeDescription
datasetstringThe queried dataset.
colunasarrayThe columns.
dataarrayThe records of the page.
countintegerHow many records came in this page.
paginaintegerReturned page (starts at 1).
tamanhointegerRows per page.
totalNaConsultaintegerTotal rows of the whole query.
temMaisbooleanThere is another page.
verValoresbooleantrue when value columns were returned.
regrasDeLinhaAplicadasintegerHow many of the key owner's row rules applied.
fontestringLive or snapshot (the daily picture).
atualizadoEmstring (date and time)Incremental mode only: when the record was last created or changed.
agrupamentostringThe grouped column, when grouping was used.
ignoradosstringIgnored filters or columns, with the reason.
truncadobooleantrue when the result exceeded the row ceiling.
avisostringText notice about the response.
mascarastringNotice when sensitive columns were omitted.

Status codes

HTTPDescription
200JSON {dataset, colunas, data, count, truncado, regrasDeLinhaAplicadas, verValores} ou text/csv
404dataset not found

Error messages

HTTPMessage (erro field)When it happens
401chave de API ausente ou inválidaNo key header, revoked key or typo.
401chave sem empresa vinculadaThe key exists but is not linked to an account. Create another one in Settings › API.
403conta de demonstração: a API pública está desligada na vitrineThe call reached the demo account, where the public API is turned off.
403identidade da chave de API irregularThe account refuses keys with irregular identity (deactivated person or ownerless key). The body brings motivo and comoResolver.
429limite de requisições excedido (120/min)The key went over its per-minute limit. Wait for Retry-After.
400informe o datasetThe dataset key is missing from the URL.
404dataset não encontrado: {dataset}The dataset does not exist or is not available to the account. Check the catalog.
500a consulta não rodouThe analytics query failed. Try fewer columns or another filter.