API referenceMailbox orders
POST
/managed-domains/{id}/check

JavaScript SDK: swarmhit.managedDomains.check(managedDomainId)

Look at an own domain again now, e.g. right after changing its nameservers: the next check runs within a minute. Returns the domain as it is now. 409 not-own-domain for a domain bought here.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/managed-domains/string/check"
{  "data": {    "id": "string",    "name": "string",    "workspaceId": "string",    "workspaceName": "string",    "platform": "google",    "live": 0,    "pending": 0,    "slotsLeft": 0,    "canAdd": true,    "reason": "full",    "adminEmail": "string",    "takenEmails": [      "string"    ],    "source": "purchased",    "connection": {      "state": "nameservers",      "stateLabel": "string",      "nameservers": [        "string"      ],      "currentNameservers": [        "string"      ],      "nameserversChangedAt": "2019-08-24T14:15:22Z",      "websiteRecords": [        {          "type": "A",          "host": "@",          "value": "string"        }      ],      "websiteRecordsCopied": true,      "dnssec": true,      "checkedAt": "2019-08-24T14:15:22Z",      "readyAt": "2019-08-24T14:15:22Z",      "movedAt": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "registrarExpiresAt": "2019-08-24T14:15:22Z"    },    "emailVerification": {      "status": "pending",      "deadline": "2019-08-24T14:15:22Z"    }  }}

Cancel a bought mailbox POST

**JavaScript SDK:** [`swarmhit.emailAccounts.cancelManaged(emailAccountId, params?)`](/smart-api/sdk/methods#emailAccounts) Cancel a mailbox bought through Swarmhit (`connectedVia: managed`). It keeps working until `cancelAt` (its renewal date), then it is removed and stops being billed; the last mailbox of a domain also stops the domain's renewal. Not gated on the managed mailboxes feature. `409` with `code: not-managed` for a mailbox the workspace connected itself; `403` with `code: not-allowed` unless the key's creator may manage billing. The domain's admin mailbox (`managed.isAdmin`) is the one every other mailbox on the domain depends on: once it is cancelled, no mailbox can ever be added to that domain again. While other mailboxes still run on the domain, cancelling it needs `confirmAdmin: true`; without it the answer is `409` with `code: admin-mailbox` and the warning to show.

Buy domains and mailboxes POST

**JavaScript SDK:** [`swarmhit.mailboxOrders.create(params)`](/smart-api/sdk/methods#mailboxOrders) Buy the quoted order: charges the workspace's card on file for the quote's `dueNowCents`, then registers the domains and creates the mailboxes. They arrive connected (no sign-in, `connectedVia: managed`) and warming unless `warmup.enabled` is false, usually within hours; follow the order on GET /mailbox-orders/{id} or the `mailbox_order.completed` / `mailbox_order.failed` webhooks. Send the `quoteId`; the order fields are optional and, when sent, must be exactly what was quoted (`409`, `code: quote-mismatch`). Buying the same quote again returns the same order with no second charge, and an `Idempotency-Key` replays the first answer to a retry. `402` with `code: no-payment-method` or `payment-failed` when the card cannot be charged; `409` with `code: quote-expired`, `price-changed` or `domain-unavailable` when the quote no longer holds (quote again); `409` with `code: payment-pending` when the charge is still being confirmed (the order appears in GET /mailbox-orders within minutes if it went through, so do not buy again); `403` with `code: not-allowed` unless the key's creator may manage billing (owner or admin of the paying workspace). Quoting needs the same right. For `existing` domains: `409` with `code: mailbox-unavailable`, `domain-full`, `domain-admin-cancelled` or `domain-not-ready`, and `404` with `code: domain-not-owned`.