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 API | Raw API | |
|---|---|---|
| What it is | Swarmhit's outreach engine: campaigns, sequences, inbox, leads, database | Direct access to the accounts: one call, one action |
| Who paces | Swarmhit (warm-up, limits, schedules) | Your application |
| Channels | LinkedIn and email | LinkedIn, WhatsApp and email |
| Base URL | https://app.swarmhit.com/api/v1 | https://console.swarmhit.com |
| Keys | swh_live_…, in Swarmhit | gw_live_… and gw_test_…, in the Raw API console |
| SDK | JavaScript SDK | Plain HTTP |
One Swarmhit login opens both; each has its own plan.
Base URL and channels
https://console.swarmhit.com| Channel | Base path | Ids |
|---|---|---|
/api/v1 | accounts lg_…, chats lgc_…, messages lgm_… | |
/whatsapp/api/v1 | accounts wa_…, chats wac_…, messages wam_…, attendees waa_… | |
/email/api/v1 | accounts 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 aremultipart/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 ofA-Z a-z 0-9 _ -) or Swarmhit makes one; it comes back in thex-request-idheader. Quote it when you report a failure.