REST API

REST API

Every tool in GTM Tools is reachable as a POST /api/v0/{tool_name} on the relevant server’s subdomain. Same JSON body shape, same auth header, no MCP client required.

Servers

ServerBase URL
Adminhttps://admin.gtm-engine.sh
Socialshttps://socials.gtm-engine.sh
Datahttps://data.gtm-engine.sh
Signalshttps://signals.gtm-engine.sh

Authentication

Every request requires a bearer token:

Authorization: Bearer sk_...

The exception is get_api_key on admin-tools, which is the bootstrap path for new accounts.

Tool discovery

GET /api/v0 returns the tool index for a server, including per-tool token costs.

$curl https://socials.gtm-engine.sh/api/v0 \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY"
1{
2 "tools": {
3 "get_linkedin_company_url": { "cost": 2 },
4 "get_linkedin_profile_url": { "cost": 5 },
5 "list_linkedin_company_employees": { "cost": 30 }
6 }
7}

Calling a tool

Every tool accepts a JSON body and returns a JSON object.

$curl -X POST https://socials.gtm-engine.sh/api/v0/get_linkedin_company_url \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{"domain": "siena.cx"}'
1{
2 "url": "https://www.linkedin.com/company/siena-cx",
3 "domain": "siena.cx"
4}

Examples

Search employees with title filters

$curl -X POST https://socials.gtm-engine.sh/api/v0/list_linkedin_company_employees \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "domain": "gorgias.com",
> "title_filters": "(CEO OR CTO OR Founder) NOT intern",
> "limit": 10,
> "page": 1
> }'

Find a professional email

$curl -X POST https://data.gtm-engine.sh/api/v0/get_email \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Justin Mares",
> "domain": "kettleandfire.com",
> "input_parameters": {"source": "linkedin"}
> }'

Run all signal detectors

$curl -X POST https://signals.gtm-engine.sh/api/v0/detect_signal \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{"domain": "gymshark.com", "techs": ["zendesk.com", "intercom.com"]}'

Check token balance

$curl https://admin.gtm-engine.sh/api/v0/get_token_balance \
> -H "Authorization: Bearer $GTM_ENGINE_API_KEY"

Error codes

StatusMeaningRecovery
400Missing or malformed parametersFix the body and retry
401Invalid or missing bearer tokenRe-issue with get_api_key
402Insufficient token balanceTop up with buy_tokens
404Tool name not found on this serverCheck the URL — wrong subdomain?
429Rate limit hitBack off; honor Retry-After header
5xxUpstream provider issueRetry with exponential backoff

Token charges are reserved at request time and refunded on 5xx failures.

Rate limits

Limits are per-org and depend on plan. Hit a limit and you’ll get 429 Too Many Requests with a Retry-After header. The CLI and SDKs (when available) will honor it automatically.

TypeScript helper

1const KEY = process.env.GTM_ENGINE_API_KEY!;
2
3type Server = "admin" | "socials" | "data" | "signals";
4
5async function call<T>(server: Server, tool: string, body: unknown = {}): Promise<T> {
6 const res = await fetch(`https://${server}.gtm-engine.sh/api/v0/${tool}`, {
7 method: "POST",
8 headers: {
9 "Authorization": `Bearer ${KEY}`,
10 "Content-Type": "application/json",
11 },
12 body: JSON.stringify(body),
13 });
14 if (!res.ok) {
15 throw new Error(`${tool} failed: ${res.status} ${await res.text()}`);
16 }
17 return res.json();
18}
19
20const url = await call<{ url: string }>("socials", "get_linkedin_company_url", {
21 domain: "siena.cx",
22});

Next steps