JavaScript SDK: swarmhit.emailAccounts.update(emailAccountId, params)
Sets the mailbox's senderId (null unlinks it). senderId is the only field. Needs the email channel enabled for the workspace (403 otherwise).
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/email-accounts/string" \ -H "Content-Type: application/json" \ -d '{ "senderId": "sNd123" }'{ "data": { "id": "string", "label": "string", "senderId": "string", "email": "string", "fromName": "string", "picture": "string", "provider": "google", "authType": "password", "connectedVia": "app", "hostedLinkId": "string", "status": "pending", "error": "string", "limits": {}, "usage": {}, "paused": true, "pausedReason": "user", "pausedAt": "2019-08-24T14:15:22Z", "trackOpens": true, "trackClicks": true, "dnsHealth": { "domain": "string", "managed": true, "spf": { "status": "ok", "reason": "string" }, "dkim": { "status": "ok", "reason": "string", "selector": "string" }, "dmarc": { "status": "ok", "reason": "string", "policy": "none" }, "checkedAt": "2019-08-24T14:15:22Z" }, "deliverabilityTest": { "status": "running", "startedAt": "2019-08-24T14:15:22Z", "finishedAt": "2019-08-24T14:15:22Z", "landing": "inbox", "spf": "string", "dkim": { "result": "string", "selector": "string" }, "dmarc": "string", "blocklists": { "ip": "clean", "domain": "clean" }, "failure": "send" }, "counters": {}, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "managed": { "provider": "string", "domain": "string", "status": "string", "renewsAt": "2019-08-24T14:15:22Z", "cancelAt": "2019-08-24T14:15:22Z", "isAdmin": true }, "warmup": { "provider": "string", "status": "pending", "statusLabel": "string", "strategy": { "preset": "conservative", "startingVolume": 1, "dailyIncrease": 1, "targetVolume": 1, "replyInbox": [ 0, 0 ], "replyPromotions": [ 0, 0 ], "replySpam": 0 }, "strategyApplied": true, "day": 0, "currentVolume": 0, "targetVolume": 0, "health": "excellent", "healthLabel": "string", "healthScore": 0, "inboxRate": 0, "startedAt": "2019-08-24T14:15:22Z", "holdUntil": "2019-08-24T14:15:22Z", "holdReason": "warming", "holdOverride": true, "syncedAt": "2019-08-24T14:15:22Z", "error": "string" }, "restoredFrom": "string" }}Run a deliverability test POST
**JavaScript SDK:** [`swarmhit.emailAccounts.testDeliverability(emailAccountId)`](/smart-api/sdk/methods#emailAccounts) Send one ordinary email from the mailbox to our test inbox. Within a few minutes the mailbox's `deliverabilityTest` reports whether it landed in the inbox or in spam (or did not arrive within 10 minutes), SPF, DKIM and DMARC as the receiving server saw them, and Spamhaus answers for the sending server and the domain. Read the mailbox to follow it (`status` goes from `running` to `done` or `failed`). One test runs at a time per mailbox, and a mailbox can run 10 a day.
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.