JavaScript SDK: swarmhit.workspaces.create(params)
Creates a workspace inside the connected organization.
Optionally grant it seats from the organization pool with
seatAllocation. Allocating more than the pool has available is
rejected with 400, unless the organization's seats are added on
demand (pay as you go): then the missing seats are added to the
subscription instead. Requires the connected workspace to be an
organization (otherwise 403).
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/workspaces" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Inc.", "seatAllocation": 2 }'{ "data": { "id": "string", "name": "string", "avatar": "string", "seatAllocation": 0, "sendersUsed": 0, "mailboxesUsed": 0, "seatsUsed": 0, "ownerId": "string", "members": [ { "id": "string", "email": "string", "username": "string", "role": "owner" } ], "orgMembers": [ { "id": "string", "email": "string", "username": "string" } ], "invites": [ { "identifier": "string", "role": "admin", "createdAt": "2019-08-24T14:15:22Z" } ] }}Set a bought mailbox's picture POST
**JavaScript SDK:** [`swarmhit.emailAccounts.setPicture(emailAccountId, params)`](/smart-api/sdk/methods#emailAccounts) Set the profile picture of a mailbox bought through Swarmhit (`connectedVia: managed`), from a public `https://` link to a JPG or PNG that our supplier downloads. Gmail shows it next to the mailbox's emails, which can take up to a day. Returns the mailbox with its new `picture`. Not gated on the managed mailboxes feature. `409` with `code: not-managed` for a mailbox the workspace connected itself: its picture is its own account's.
Delete a workspace DELETE
**JavaScript SDK:** [`swarmhit.workspaces.delete(workspaceId)`](/smart-api/sdk/methods#workspaces) Removes the workspace from the organization. Rejected with `400` while it still has connected sender accounts or mailboxes, disconnect them first.