API referenceEmbedded components
DELETE
/embed/users/{id}/sessions

JavaScript SDK: swarmhit.embed.users.revokeSessions(userId)

Ends every session of one of your users at once: secrets not used yet stop working and their open components are signed out. Call it when a user leaves your platform or loses access. revoked is false when that user never had a session.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string

Your id for the user, as given in user.id when you created their session.

Response Body

application/json

application/json

application/json

curl -X DELETE "https://example.com/embed/users/string/sessions"
{  "data": {    "user": {      "id": "string"    },    "revoked": true  }}

Create an embedded session POST

**JavaScript SDK:** [`swarmhit.embed.sessions.create(params)`](/smart-api/sdk/methods#embed.sessions) Starts a session for one of your users, so your page can show them the Swarmhit inbox, tasks and campaigns. Call it from your backend, never from the browser: it takes your API key. Pass the returned `clientSecret` to your page, which hands it to the embedded components. On the page: load `https://app.swarmhit.com/embed.js`, place an element such as `<swarmhit-inbox theme="auto">`, and call `Swarmhit.init({ fetchClientSecret })` with a function that asks your backend for a secret. The integration guide has the full walkthrough. The elements are `<swarmhit-inbox>`, `<swarmhit-tasks>` and `<swarmhit-campaigns>`. Each one calls `fetchClientSecret` when it loads and again when its session ends, so the function must return a fresh secret every time. The secret works once and only for 5 minutes. The session it starts lasts 12 hours. The user reaches only the LinkedIn accounts in `accountIds`: their conversations, and the campaigns whose every sender is one of them. They reach none of your settings, accounts or billing. `permissions` says what they may do there, for example `["inbox", "tasks", "campaigns.analytics", "campaigns.leads"]`. A screen's name (`inbox`, `tasks`, `campaigns`) grants all of that screen; an edit permission includes its read. Screens and tabs the user lacks are not shown, and Swarmhit refuses anything outside them, so the list is the boundary, not a display setting. Campaigns they create send from their accounts. Your latest session for a user sets what all of their open components reach, so a call with fewer accounts or permissions narrows the screens they already have open.

API info GET

**JavaScript SDK:** [`swarmhit.info()`](/smart-api/sdk/methods#client) Returns API metadata and the workspace the request acts on (the key's own, or the one `X-Swarmhit-Workspace` names), including its effective plan, seat usage per channel, whether it is an organization or a workspace inside one, its tracking domain and this period's email allowance. Handy for verifying a key works and what a header resolves to.