TenkaTenka
Sign in

Tenka Help Center › Platform and security › API keys

API keys

Access to the public API (integration and BI) per tenant. You create keys, understand the rules, see the endpoints, and test without leaving Tenka. The key sees your data read-only, always isolated by company.

🕒 Updated on Oct 20, 2026📖 ~11 min read

What you find on this screen

A portrait of the screen, read from the screen itself — it changes when the screen changes.

Available actions

Generate keyGenerate sandbox keyI've copied it, closeTestCancelSave

Form fields

NomePara que serve esta chave. Nome vago é o que impede revogar sem medo depois.
PrefixoOs primeiros caracteres da chave. É por eles que se reconhece a chave no log sem expor o segredo.
Criada em
EscopoO que esta chave pode alcançar. Escopo largo transforma vazamento em incidente grande.
AtivaChave inativa deixa de autenticar na hora, sem precisar apagar o cadastro.
Último usoQuando a chave foi usada por último. Vazia há meses é candidata a revogação.
Revogada emQuando a chave foi cassada. Preenchida, nenhuma chamada com ela passa mais.
Escopos de escritaOnde esta chave pode gravar, não só ler. É a parte que muda dado do cliente.

Start here

What you do here
Generate and manage your company's API keys to integrate Tenka with BI (Power BI, Metabase), spreadsheets or your own systems. Each key gives read-only access to your data via the REST API.
Excel and Power BI: OData feed, no coding
Generate a key just for this. In Excel: Data ▸ Get Data ▸ From Other Sources ▸ OData Feed ▸ paste the feed URL; under Advanced, add the Authorization header with the value "Bearer SUA_CHAVE". Excel lists the tables (Customers, Contracts, Transactions…) and follows the pages on its own. In Power BI it's the same path (OData feed).
Google Sheets: CSV por fórmula
In a cell: =IMPORTDATA("…/api/v1/feed/csv/clientes.csv?api_key=SUA_CHAVE&sep=,&dec=."). The sep=, and dec=. make Sheets read the numbers as numbers. Each resource has its own CSV (contratos.csv, movimentacoes.csv…).
Keys in a list, issuing at the top
The list shows each key with name, prefix, when it was created and last used, status, MCP scope and the irregular-identity mark. At the top are the one-key-per-person rules, the readiness for the identity switch and the Generate key panel — the key is created in your name and shown in clear text only once: copy it right away.

How to

Create a key
Give it a name (e.g., "Power BI integration") and click Generate key. The key appears only once — copy it and store it in a secrets vault. Only the hash is kept in the database; not even support can recover the key afterward. If it leaks or is no longer needed, use Revoke (the integration stops immediately).
Endpoints disponíveis
/api/v1/me — your tenant's data.
/api/v1/clientes — id, code, name, CPF/CNPJ.
/api/v1/contratos — number, status, term.
/api/v1/movimentacoes — description, amount, due date, status.
/api/v1/tickets — requests.
Test without leaving Tenka
Use the "Test now" block: paste the key, choose the resource and click Test — Tenka calls its own API and shows the JSON. Or click "Open explorer (Swagger UI)" to browse and test each endpoint visually (Authorize button → paste the key). To generate an automatic client, download the OpenAPI specification (JSON) and import it into Postman or a code generator.
"Medidor sem dado" não é o mesmo que "pronto"
If there's no key registered, the panel says METER WITHOUT DATA — not "ready to switch". The difference matters: zero flagged keys out of zero existing keys proves nothing, and treating that as approval is the most common way for a meter to lie. If the measurement can't classify everything, it also warns you, instead of completing the count with a guess.
Connect Power BI or Metabase to a Tenka dataset
With your key: GET https://SEU-TENKA/api/v1/analitico lists the datasets (the platform's and those your company created in BI), with their columns and what's filterable. To fetch a dataset: GET /api/v1/analitico/financeiro?formato=csv — Power BI (Get Data ▸ Web) and Metabase (CSV/URL source) read it directly. Parameters: colunas=a,b · filtros=campo=valor;campo2>valor2;campo3~contem · agrupamento=campo · funcao=SOMA|MEDIA|CONTAGEM|MAIOR|MENOR|MEDIANA. The JSON carries count, truncado and regrasDeLinhaAplicadas; the CSV comes with a BOM so Excel opens it as UTF-8 and a last line "# TRUNCADO" when it went past 1,000 rows.
Third-party AI agents via MCP: the BI datasets
Tenka's MCP server (/mcp, with the same key) now offers listar_datasets_bi (the catalog), metricas_do_dataset_bi (what can be measured in a source) and consultar_dataset_bi (the rows, or the grouping by one dimension, up to 50 rows per answer with the total declared). An AI assistant connected to your Tenka answers "how much did we sell per customer this month" by reading the governed dataset — never the database. The row rules and View Amounts of the key's owner apply just the same.
Retrato diário: o dataset instantâneo para o BI externo
Add ?fonte=snapshot to the dataset query (/api/v1/analitico/financeiro?fonte=snapshot&formato=csv) to receive the snapshot recorded at the company's configured time, with atualizadoEm in the response — instant and without touching the operational database, ideal for Power BI to refresh overnight. When there's no snapshot (new company, or the key's owner has a row rule, which the snapshot doesn't slice), the API answers live and says so in `fonte`.
Paginação da API analítica: pagina e tamanho
GET /api/v1/analitico/{dataset}?pagina=2&tamanho=200 returns the second page of 200 rows of the queried set (which respects the 1,000-row cap, declared in "truncado"). The response carries pagina, tamanho, totalNaConsulta and temMais. Without the parameters, the whole set comes up to the cap, as before. It applies to JSON and CSV.
How to use the API, collapsed at the top
The collapsible "How to use the API" box gathers the rules (authentication, read only, company scope, pagination and limit), the endpoints, the tester that calls the API itself with the pasted key, and the ready URLs of the feed for Excel, Power BI and Google Sheets.
Agent-to-agent (A2A)
Com o A2A ligado na plataforma, outro agente de IA descobre o Tenkai em /.well-known/agent.json e pede tarefas em /a2a com a mesma chave de API: cada ferramenta de leitura é uma skill, com as mesmas permissões da chave e do usuário dono dela. Só leitura — escrita continua pelo MCP, em dois passos.
Where the API documentation is
Na Central de Ajuda, em Área do desenvolvedor (/central-ajuda/desenvolvedores). À esquerda fica o guia — começar, autenticação, paginação, erros, limites, idempotência, webhooks e SDK — e a referência de cada operação. Em cada operação estão os parâmetros, os campos da resposta, as mensagens de erro e exemplos para copiar em cURL, JavaScript, Python, Java, C#, PHP e Node.
Example for the weaving and dyeing integrator
Read only the rolls that changed: GET /api/v1/rolos?desde=2026-10-17T00:00:00 with the header Authorization: Bearer ; keep the date of the last roll received and use it as the next desde. Send rolls to the processor: POST /api/v1/remessas with the headers Authorization: Bearer and Idempotency-Key: and the body {"idFornecedor": 12, "tipoServico": "TINTURARIA", "rolos": [101, 102]}. Repeating the call with the same Idempotency-Key returns the same shipment, without duplicating it. The key must be allowed to write and only reaches the screens its profile sees.

Rules

How to authenticate
Send the key in the header Authorization: Bearer <key> (or X-API-Key). Example:
curl -H "Authorization: Bearer tnk_..." SEU_TENKA/api/v1/clientes?limit=50
Scope and limits
The key only sees the data of your company (tenant isolation). It is read-only (GET). Pagination via ?limit (max. 200) and ?offset. Limit of 120 requests per minute per key (returns HTTP 429 if exceeded).
Os três estágios da governança de identidade
Every call to the public API answers with the access of ONE person — the key's owner. When the key has no owner, or the owner has left, there's no access to apply, and the platform has three possible stances: OBSERVE (just logs), WARN (serves and returns a header saying it will refuse one day) and REFUSE (403, with the reason and the fix in the body). Today the account is on WARN.
Por que a virada para RECUSAR não tem data marcada
Because switching too early brings down the integration of whoever relies on the account — and those who rely on it are precisely the ones not watching. The criterion was never a deadline: it's this screen no longer showing any flagged key. As long as there's one, the readiness panel says how many there are, which ones and what to do with each. When it reaches zero, it says it's ready, and switching becomes a risk-free decision.
Mesma chave, mesmo escopo, mesma governança
The feed is the v1 API in another format: read-only, scoped to the key's account, with the same rate limit. Revoking the key cuts off Excel and Sheets immediately. Monetary columns follow the API rule for keys without an owner.
O dataset sai com a MESMA governança do painel
The reader is the key's owner. Their group's row rules (Dashboards ▸ component ▸ "Row rules for this source") are applied before any filter of yours; value columns only come out if the owner can see amounts — a missing column is the mask, not an error. Every query leaves a trail in the Audit log (who, which dataset, how many rows). A direct database connection deliberately doesn't exist: it would break the isolation between companies and the governance of amounts.
Delete means revoke
API keys do not go to the trash: deleting (or the Revoke button) revokes the key, which stops authenticating right away, and the revocation is kept in the audit trail. On the record only the name is edited; the MCP (read) and write scope changes through the Scope button — empty write means no write at all.
Sandbox key: test the integration without touching production
In Settings › API keys, the "Generate sandbox key" button issues a key that starts with tnk_sbx_. It only works at the sandbox address: a separate server with demo data, on the same version as production, that returns to its initial state every week — test reads and writes freely. It is valid for 90 days and up to 1,000 calls per day; above the ceiling, the sandbox answers "limit reached" until midnight. Production rejects it with the explanation, and the sandbox rejects production keys. Save the key when you generate it: it is shown only once.
Another AI agent asking for tasks (A2A)
When the platform opens A2A and the account turns it on in Settings › Parameters › Integrations, another AI agent uses a key from this screen to ask Tenkai for tasks. It sees only what the key owner sees. Queries come back right away. Actions, such as settling a bill, are only proposed: the task waits, the person authorizes and the agent confirms in the same task; until then nothing is saved, and the proposal expires in 15 minutes. To allow actions, tick on the key the ones it may propose. Every request goes to the Audit log.
Key for textile objects
Rolls, lots, shipments, production orders, tech sheets and cutting tickets only leave through the key if its owner has access to the screen the data comes from (Rolls, Lot trace, Outsourced processing, Production orders, Tech sheet, Cutting order). To open a shipment or post production, the key must allow writing and the owner must be able to add on that screen. Create the key in the name of whoever runs those screens; without access, the response says which screen is missing.

Frequently asked questions

Who can access this screen
Tenant administrator (same audience as "Users and access groups"). The keys apply to the whole company — treat them like a password.
The key of someone who left the company: what happens?
It appears flagged here. Today the call is still served and comes back with a warning in the header; after the switch, it starts getting 403. It's the most common case and the most dangerous: the integration keeps working months after the departure, with the access of someone who no longer works at the company. The fix is to issue one key per ACTIVE person and revoke the old one — never reuse the key by transferring the owner.
Por que não um add-in do Office?
An add-in requires a Microsoft Partner Center account, store publication and maintenance per Office version — and none of the competitors starts with one. The OData feed is the native path for Excel and Power BI, works on Mac and in the browser, and slots into a spreadsheet that already exists.
Why a colored strip appears at the top of the screen
The strip tells you that you are not in production: STAGING (the server where the team checks the next version), SANDBOX (the integration test environment, with demo data recreated every week) or DEVELOPMENT. On these servers no e-mail, WhatsApp, billing, invoice, phone notice or call to another system really goes out: everything is recorded as blocked. In production the strip does not appear.

Connected screens

Was this article helpful?

In the same module: Platform and security38

Tenka Academy

Step-by-step learning paths for your industry, inside the platform.

Explore the Academy