Runnable examples for the GTM API LinkedIn API: search people, enrich profiles, send connection requests and messages over plain HTTPS. Every connected LinkedIn account runs in its own anti-detect cloud browser with a dedicated proxy; GTM API reports 20,000+ connected accounts at under 1% monthly ban rate.
Full reference and guides live at docs.gtm-api.com. For how the official, third-party and MCP options compare, read LinkedIn API in 2026: The Developer Guide.
- Sign up at app.gtm-api.com (7-day trial, no card) and connect a LinkedIn account you own.
- Mint an API key in the app. The secret looks like
gtm_live_plus 40 characters and is shown exactly once. - Export it:
export GTM_API_KEY="gtm_live_YOUR_KEY"The base URL is https://app.gtm-api.com/linkedin/v4 and the key goes in the Authorization
header as a bearer token. Read calls work right after connect; outbound actions (invitations,
messages) become available once the account's initial sync finishes.
curl -X POST "https://app.gtm-api.com/linkedin/v4/api/linkedin-accounts/search" \
-H "Authorization: Bearer $GTM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"page_size": 5}'Examples 1 to 10 call the LinkedIn service at https://app.gtm-api.com/linkedin/v4. Mass
actions and webhooks (11 and 12) are platform-wide, so they live on the orchestration service
at https://app.gtm-api.com/orchestration/v4. Same key, same envelope.
The curl scripts read GTM_API_KEY from the environment:
./examples/curl/02-search-people.sh "growth marketing"The TypeScript examples run on Node 18+ with tsx and have no other dependencies:
npx tsx examples/typescript/02-search-people.ts "growth marketing"Every success returns the same envelope, and every error carries a machine-readable
error.code. The full contract, including all error codes, is documented in
envelopes and errors.
{
"success": true,
"operation": "search",
"items": [
{
"item": {
"sid": "ln_ac_Hx7kQ3mN2pL4",
"status": "active",
"full_name": "Jane Cooper"
},
"included": {}
}
],
"counts": { "total_count": 1, "groups": { "status": { "active": 1 } } },
"pagination": { "next_cursor": null, "has_more": false, "total_count": 1 },
"meta": { "trace_id": "0198f2ab-7c11-7e32-9a41-d2b64f2a91c3" }
}Every entity has a stable sid with a type prefix: ln_ac_ for LinkedIn accounts, ln_cv_
for conversations, wh_hk_ for webhooks.
- Outbound sends are gated server-side by per-account daily limits and a warmup curve. A second connection request to someone with one already pending returns a 409 instead of burning the account. The platform side of staying safe: Safe LinkedIn Automation.
- Search and enrichment can run through the platform executor pool (charged in credits), or
through your own account when you pass
linkedin_account_sid. Add anidempotency_keyto any paid call to make retries free. - Bulk flows never fire from one call: preview validates the plan and mints a 15-minute
commit_token, and the commit spends it. Details in run a mass action. - Reads of already-synced data (accounts, conversations, messages) cost nothing and touch no LinkedIn page. Search, enrichment and sends do reach LinkedIn through the account's browser.
The same API ships as an MCP server: linkedin-mcp. For when MCP beats calling REST directly, read LinkedIn MCP Server.
MIT