Swarmhit API (1.0.0)

Download OpenAPI specification:

The Swarmhit API lets you manage LinkedIn outreach campaigns, contacts and your inbox programmatically, and receive real-time events via webhooks.

Base URL

https://app.swarmhit.com/api/v1

Authentication

Every request must carry an API key as a bearer token:

Authorization: Bearer swh_live_xxxxxxxxxxxxxxxxxxxxxxxx

Create and revoke keys under Settings → API & Webhooks in the Swarmhit app. A key's full value is shown only once, at creation — store it securely. Each key is scoped to the workspace it was created in.

Pagination

List endpoints accept limit (1–100, default 50) and offset query parameters, and return a paging object alongside data.

Errors

Errors use standard HTTP status codes with a JSON body:

{ "error": { "status": 404, "message": "Campaign not found." } }

Webhooks

Register webhook endpoints under Settings → API & Webhooks. Swarmhit POSTs a JSON payload to your URL when a subscribed event occurs. Every request includes these headers:

  • X-Swarmhit-Event — the event type
  • X-Swarmhit-Delivery — a unique delivery id; delivery is at-least-once, so use this to deduplicate
  • X-Swarmhit-Signature — an HMAC-SHA256 hex digest of the raw request body, keyed by the endpoint's signing secret

Verify the signature before trusting a payload:

const crypto = require('crypto');
const expected = crypto
  .createHmac('sha256', SIGNING_SECRET)
  .update(rawRequestBody)
  .digest('hex');
const ok = crypto.timingSafeEqual(
  Buffer.from(expected),
  Buffer.from(req.headers['x-swarmhit-signature'] || ''),
);

Respond with any 2xx status to acknowledge receipt. Non-2xx responses are retried with exponential backoff; an endpoint that keeps failing is automatically disabled.

General

Service metadata.

API info

Returns API metadata and the workspace the key belongs to. Handy for verifying a key works.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Campaigns

Outreach campaigns and their leads.

List campaigns

Authorizations:
bearerAuth
query Parameters
limit
integer [ 1 .. 100 ]
Default: 50

Page size, 1–100.

offset
integer >= 0
Default: 0

Number of records to skip.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Get a campaign

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Add leads to a campaign

Adds leads from LinkedIn profile URLs. Each profile is resolved best-effort for templating fields; an unresolved profile is still added. Leads already in the campaign are skipped. Max 100 per request.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
required
required
Array of strings or LeadInput (object) <= 100 items

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Contacts

The workspace address book.

List contacts

Authorizations:
bearerAuth
query Parameters
limit
integer [ 1 .. 100 ]
Default: 50

Page size, 1–100.

offset
integer >= 0
Default: 0

Number of records to skip.

search
string

Case-insensitive match on name, headline, email or company.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Create contacts

Adds contacts to the workspace address book from LinkedIn profile URLs. Pass a single contact, or a contacts array (max 100). Contacts are deduplicated on their LinkedIn identifier.

Authorizations:
bearerAuth
Request Body schema: application/json
required
One of
profileUrl
required
string
firstName
string
lastName
string
fullName
string
headline
string
jobTitle
string
company
string
email
string
location
string

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Inbox

LinkedIn conversations.

List inbox chats

Authorizations:
bearerAuth
query Parameters
limit
integer [ 1 .. 100 ]
Default: 50

Page size, 1–100.

offset
integer >= 0
Default: 0

Number of records to skip.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

List messages in a chat

Authorizations:
bearerAuth
path Parameters
id
required
string
query Parameters
limit
integer [ 1 .. 100 ]
Default: 50

Page size, 1–100.

offset
integer >= 0
Default: 0

Number of records to skip.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Send a message in a chat

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
required
text
required
string

Responses

Request samples

Content type
application/json
{
  • "text": "Thanks for connecting! Happy to share more."
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Reply received Webhook

Sent when a lead replies to a LinkedIn message.

Authorizations:
bearerAuth
header Parameters
X-Swarmhit-Event
string

The event type.

X-Swarmhit-Delivery
string

Unique delivery id — delivery is at-least-once, so use this to deduplicate.

X-Swarmhit-Signature
string

HMAC-SHA256 hex digest of the raw request body, keyed by the endpoint's signing secret.

Request Body schema: application/json
event
string
Value: "message.received"
workspaceId
string
createdAt
string <date-time>
object

Responses

Request samples

Content type
application/json
{
  • "event": "message.received",
  • "workspaceId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "data": {
    }
}

Connection accepted Webhook

Sent when a lead accepts the connection request.

Authorizations:
bearerAuth
header Parameters
X-Swarmhit-Event
string

The event type.

X-Swarmhit-Delivery
string

Unique delivery id — delivery is at-least-once, so use this to deduplicate.

X-Swarmhit-Signature
string

HMAC-SHA256 hex digest of the raw request body, keyed by the endpoint's signing secret.

Request Body schema: application/json
event
string
Value: "connection.accepted"
workspaceId
string
createdAt
string <date-time>
object

Responses

Request samples

Content type
application/json
{
  • "event": "connection.accepted",
  • "workspaceId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "data": {
    }
}

Lead status changed Webhook

Sent when a lead reaches a resting status — replied, done, failed or paused.

Authorizations:
bearerAuth
header Parameters
X-Swarmhit-Event
string

The event type.

X-Swarmhit-Delivery
string

Unique delivery id — delivery is at-least-once, so use this to deduplicate.

X-Swarmhit-Signature
string

HMAC-SHA256 hex digest of the raw request body, keyed by the endpoint's signing secret.

Request Body schema: application/json
event
string
Value: "lead.status_changed"
workspaceId
string
createdAt
string <date-time>
object

Responses

Request samples

Content type
application/json
{
  • "event": "lead.status_changed",
  • "workspaceId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "data": {
    }
}

Campaign finished Webhook

Sent when a campaign has completed every one of its leads.

Authorizations:
bearerAuth
header Parameters
X-Swarmhit-Event
string

The event type.

X-Swarmhit-Delivery
string

Unique delivery id — delivery is at-least-once, so use this to deduplicate.

X-Swarmhit-Signature
string

HMAC-SHA256 hex digest of the raw request body, keyed by the endpoint's signing secret.

Request Body schema: application/json
event
string
Value: "campaign.finished"
workspaceId
string
createdAt
string <date-time>
object

Responses

Request samples

Content type
application/json
{
  • "event": "campaign.finished",
  • "workspaceId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "data": {
    }
}