Getting started

Your LinkedIn accounts, WhatsApp numbers and mailboxes through one REST API.

The Raw API runs your LinkedIn accounts, WhatsApp numbers and mailboxes and gives you direct access to them: connect an account, read its conversations, send messages and invitations, react, search, and receive every event as a signed webhook. The same paths, request bodies, response fields, error envelope and events work on every channel.

You decide, Swarmhit executes. Pacing, daily limits, warm-up and schedules belong to your application. Swarmhit keeps each account signed in, on its own device and IP, and only refuses what a runaway client would do (see Write safety).

Smart API or Raw API?

Smart APIRaw API
What it isSwarmhit's outreach engine: campaigns, sequences, inbox, leads, databaseDirect access to the accounts: one call, one action
Who pacesSwarmhit (warm-up, limits, schedules)Your application
ChannelsLinkedIn and emailLinkedIn, WhatsApp and email
Base URLhttps://app.swarmhit.com/api/v1https://console.swarmhit.com
Keysswh_live_…, in Swarmhitgw_live_… and gw_test_…, in the Raw API console
SDKJavaScript SDKPlain HTTP

One Swarmhit login opens both; each has its own plan.

Base URL and channels

https://console.swarmhit.com
ChannelBase pathIds
LinkedIn/api/v1accounts lg_…, chats lgc_…, messages lgm_…
WhatsApp/whatsapp/api/v1accounts wa_…, chats wac_…, messages wam_…, attendees waa_…
Email/email/api/v1accounts em_…, emails emm_…, folders emf_…, OAuth apps emo_…

Your first requests

Create an API key in the console (API keys). Start with a sandbox key (gw_test_…): the same API, with LinkedIn, WhatsApp and the mail servers played by Swarmhit, so you can build without a real account (see Sandbox).

Connect a LinkedIn account with its email and password:

curl -X POST https://console.swarmhit.com/api/v1/accounts \
  -H "X-API-KEY: gw_test_your_key_here" -H "Content-Type: application/json" \
  -d '{"provider":"LINKEDIN","username":"jane.doe@example.com","password":"…","country":"FR"}'

The answer is 201 (signed in, with its account_id), 202 with a checkpoint (LinkedIn wants a code or a CAPTCHA, see LinkedIn), or an error. Then send a message:

curl -X POST https://console.swarmhit.com/api/v1/chats \
  -H "X-API-KEY: gw_test_your_key_here" -H "Content-Type: application/json" \
  -d '{"account_id":"lg_3f9c2a7b1d","attendees_ids":["ACoAAB1a2b3c4d5e6f"],"text":"Hello Jane"}'

Link a WhatsApp number (the answer carries a QR code to scan with the phone):

curl -X POST https://console.swarmhit.com/whatsapp/api/v1/accounts \
  -H "X-API-KEY: gw_test_your_key_here" -H "Content-Type: application/json" \
  -d '{"provider":"WHATSAPP","country":"FR"}'

Requests and responses

  • JSON in and out (Content-Type: application/json). Sends with files are multipart/form-data: bodies up to 30 MB, a file up to 20 MB, 10 files a request.
  • Validation is loose on purpose: unknown fields are ignored, optional fields may be null, and scalars are coerced (a code sent as a number arrives as a string).
  • Dates are ISO 8601 strings in UTC, except where a field says milliseconds.
  • X-Request-Id: send your own (8 to 64 characters of A-Z a-z 0-9 _ -) or Swarmhit makes one; it comes back in the x-request-id header. Quote it when you report a failure.

Next steps

On this page