मुख्य सामग्री पर जाएँ
Tecrübetecrube.com
First steps

API and clients

API key authentication on the Enterprise plan: scopes, rate limits, the OpenAPI reference, Python and JavaScript clients, and connecting with the MCP SDKs.

Quick start

Create a key under Settings › API in the panel and send it with every request in the Authorization header.

bash
curl https://tecrube.com/api/v1/account/me \
  -H "Authorization: Bearer tk_your_key"

Authentication and scopes

  • A key starts with tk_ and is shown only once, when it is created; only its hash is stored.
  • A key can't exceed the authority of the person who created it. If that person leaves the team the key stops working; if their role drops, a write key falls back to read.
  • If the plan loses API access, requests return 402. An account can have at most 20 active keys.
ScopeCanCan't
readRead all dataChange anything or start work
writeAct as a workspace admin; changes follow your approval rulesTeam, password, session, 2FA, plan and payment actions

Rate limits

  • API: 600 requests per minute per key.
  • MCP tools: 120 calls per minute per key and 2,000 calls per hour per account.
  • Over the limit you get 429 with a Retry-After header. The ready-made clients retry reads and 429 by themselves.

Error codes

CodeMeaning
401Key missing, invalid or revoked
402The plan doesn't include this action
403Scope or role isn't sufficient
404Record not found
422Invalid body or parameter
429Rate limit exceeded
5xxTemporary server problem; retry read requests

OpenAPI reference

Download the current OpenAPI document of every endpoint your key can reach. Import it into Postman, or generate clients for other languages with openapi-generator.

bash
curl https://tecrube.com/api/v1/api-referansi/openapi.json \
  -H "Authorization: Bearer tk_your_key" \
  -o tecrube-openapi.json

Ready-made clients

No dependencies: install the package, or drop the single file into your project and import it. Includes REST, MCP tools, retries and an error type.

Python
pip install tecrube
JavaScript
npm install tecrube
Python
from tecrube import Tecrube, TecrubeError

client = Tecrube("tk_your_key")

me = client.get("/account/me")
campaigns = client.call_tool("list_campaigns", days=7)

try:
    client.post("/account/brands", {"name": "New project"})
except TecrubeError as e:
    print(e.status, e.message)
JavaScript
import { Tecrube, TecrubeError } from "tecrube";

const client = new Tecrube(process.env.TECRUBE_API_KEY);

const me = await client.get("/account/me");
const campaigns = await client.callTool("list_campaigns", { days: 7 });

try {
  await client.post("/account/brands", { name: "New project" });
} catch (e) {
  if (e instanceof TecrubeError) console.error(e.status, e.message);
}

Connecting with the MCP SDKs

The official MCP SDKs (TypeScript and Python) connect to this URL. If you're building your own assistant or agent, send the key in the header; apps acting for other users use OAuth 2.1.

TypeScript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(new URL("https://tecrube.com/mcp"), {
  requestInit: { headers: { Authorization: `Bearer ${process.env.TECRUBE_API_KEY}` } },
});
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);
const { tools } = await client.listTools();

Mobile app SDK

Tecrube has no SDK to embed in your mobile app, and you don't need one. For in-app measurement you install Google Analytics for Firebase, the Meta SDK and the TikTok SDK directly; Tecrube reads their data through your accounts.

Next steps