Create a tenant workspaceMenu

Create a tenant workspace

POST/v1/workspaces

Requires an API key with the workspaces:manage scope. About keys and scopes

Partner keys only.

A repeat after success is refused with 409 ALREADY_EXISTS: read the one the first created. About idempotency

Creates a child workspace for one tenant of your product, identified by your own externalId, so you never need to store ours. Partner keys only. From then on, any /v1 call with the header Kirora-Workspace: <externalId> acts in that workspace with your key: load its contacts, verify its sending domain, send. The workspace has no members and bills to your account. A repeated externalId is 409 ALREADY_EXISTS. While your own workspace is being deleted this is 403 WORKSPACE_DELETION_PENDING; cancel the deletion to create workspaces again.

Header parameters

Idempotency-Keystringoptional

Makes a retry safe: a repeat with the same key and body within 24 hours gets the first response again, with Idempotency-Replay: true. The same key with another request is 409 IDEMPOTENCY_KEY_REUSED; while the first is still running, 409 IDEMPOTENCY_KEY_IN_USE; after an unsafe first request failed or never returned, 409 IDEMPOTENCY_KEY_OUTCOME_UNKNOWN. Use a new key, such as a UUID, for each new request.

8–255 characters

Request body

namestringrequired

1–200 characters

externalIdstringrequired

Your own id for the tenant (up to 128 letters, digits, ., :, _, -); unique among your workspaces.

pattern ^[A-Za-z0-9._:-]{1,128}$

countrystringrequired

Two-letter ISO 3166-1 country code.

timezonestringoptional

IANA timezone, such as Europe/Berlin.

1–64 characters

currencystringoptional

ISO 4217, the currency the tenant prices in; its revenue totals convert into it. Omitted: the country's.

pattern ^[A-Z]{3}$

websitestring | nulloptional

The business's website.

uri · up to 500 characters

mailKindstring | nulloptional

What the workspace sends.

one of marketing, transactional, both

contactOptInstring | nulloptional

How its contacts agreed to hear from it: a signup form, checkout, an app.

1–1,000 characters

Returns

Returns 201 Created with a Workspace in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.

  • 201 CreatedThe new workspace.
  • 409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.
  • 413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).
  • 415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
idstringrequired

uuid

externalIdstringrequired

Your own id for the tenant.

namestringrequired
countrystringrequired

Two-letter ISO 3166-1 country code.

2 characters

timezonestringrequired

IANA timezone; decides local-time sends and report days.

currencystringrequired

ISO 4217; the currency its revenue totals convert into.

3 characters

statusstringrequired

suspended refuses every send in the workspace until it is resumed; deleting refuses them too, and the workspace is purged unless the deletion is cancelled.

one of active, suspended, deleting

suspendedAtstring | nullrequired

When it was suspended; null if not.

date-time

deletionRequestedAtstring | nullrequired

When deletion was asked for; null if not.

date-time

deletesAtstring | nullrequired

When the workspace and everything in it is deleted for good, unless the deletion is cancelled before; null if no deletion is pending.

date-time

websitestring | nullrequired

The business's website.

uri · up to 500 characters

mailKindstring | nullrequired

What the workspace sends.

one of marketing, transactional, both

contactOptInstring | nullrequired

How its contacts agreed to hear from it: a signup form, checkout, an app.

1–1,000 characters

createdAtstringrequired

date-time

Headers on 201 Created

Idempotency-Replaystringoptional

true when this is the stored response to an earlier request with the same key.

one of true