API reference

Spaces

Create and manage spaces with an account key

These routes serve products that send email on behalf of their own customers: one space per blog, client or workspace, each with its own reputation, on a single bill. Spaces explained.

These routes require an account key (Account › Account API keys). A space key answers 403. Space and account keys.

The pattern

  1. Create the space the first time a customer needs to send, with your own id as externalId. The same externalId returns the existing space: safe to run on every send.
  2. Add their domain with POST /v1/domains and the header X-Space-Id, then show the DNS records to your customer (or publish them if you manage their DNS).
  3. Send with the same account key and X-Space-Id on every request: emails, contacts, campaigns.
# 1. Create (or find) the space of blog 42
curl https://api.kulamail.com/v1/spaces \
  -H "Authorization: Bearer ml_your_account_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "The Daily Fern", "externalId": "blog_42" }'

# 2. Add its domain
curl https://api.kulamail.com/v1/domains \
  -H "Authorization: Bearer ml_your_account_key" \
  -H "X-Space-Id: 9b8a7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d" \
  -H "Content-Type: application/json" \
  -d '{ "domain": "dailyfern.com" }'

The space object

{
  "id": "9b8a7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
  "name": "The Daily Fern",
  "externalId": "blog_42",
  "timezone": "UTC",
  "defaultFromName": "The Daily Fern",
  "defaultFromEmail": "hello@dailyfern.com",
  "defaultReplyTo": null,
  "trackOpens": true,
  "trackClicks": true,
  "confirmAddressOnce": false,
  "brandColor": "#2f6f4e",
  "buttonColor": null,
  "buttonTextColor": null,
  "logoUrl": "https://dailyfern.com/logo.png",
  "emailTheme": {
    "textColor": null,
    "headingColor": null,
    "linkColor": null,
    "backgroundColor": "#f3f1ea",
    "contentBackgroundColor": null,
    "mutedColor": null,
    "fontFamily": "lora",
    "headingFontFamily": null,
    "fontSize": null,
    "width": null,
    "contentStyle": "plain",
    "contentRadius": null,
    "buttonRadius": "pill",
    "buttonSize": null,
    "logoWidth": 120,
    "logoAlign": null,
    "showHeader": null,
    "socialLinks": [{ "network": "instagram", "url": "https://instagram.com/dailyfern" }]
  },
  "reputationStatus": "OK",
  "marketingPaused": false,
  "test": false,
  "createdAt": "2026-10-17T09:30:00Z"
}
FieldMeaning
externalIdYour own reference, unique in the account and the mode (live or test)
defaultFromName, defaultFromEmail, defaultReplyToSender used when an email doesn't set one. The address must use a verified domain of the space
trackOpens, trackClicksOpen pixel and click tracking of marketing emails, on by default. Transactional emails are tracked only when sent with track
confirmAddressOncetrue: double opt-in confirms an address once for the space, a contact subscribed to one list joins another without confirming again. false (default): each list asks for its own confirmation. Double opt-in
brandColor, logoUrlBranding of emails and hosted pages (unsubscribe, preferences, confirmation). Default color #c2602a, no logo
buttonColor, buttonTextColorColors of email buttons. null: the brand color, and white or dark text, whichever reads best
emailThemeThe rest of the email design. null fields take the default. Email theme
reputationStatusOK, WATCH or ALERT, over the last 7 days. Reputation
marketingPausedtrue when campaigns and flows are paused. Transactional emails keep flowing
testtrue for a test space: nothing is delivered

List spaces

GET /v1/spaces

Every space of the account in the mode of the key, oldest first: test spaces with a test key (ml_test_), live spaces otherwise.

Create a space

POST /v1/spaces

name
string required
120 characters at most.
externalId
string
Your own reference, 120 characters at most. If a space of the account already has it, that space is returned unchanged.
brandColor
string
Color of buttons and links, #rrggbb. White text sits on it: pick a dark enough color.
logoUrl
string
Public https URL of a PNG or JPG logo, 1000 characters at most. SVG is refused: Gmail and Outlook don't show it.

An invalid brandColor or logoUrl answers 400.

A test key (ml_test_) creates a test space.

Returns 201 with the space object, or 200 with the existing space when the externalId is already used.

The free plan includes one live space: creating another answers 402 quota_exceeded. Test spaces do not count. Plans.

Get a space

GET /v1/spaces/{id}

Update a space

PATCH /v1/spaces/{id}

Changes the fields sent; the others stay as they are.

name
string
120 characters at most.
defaultFromName
string
Default sender name.
defaultFromEmail
string
Default sender address, on a verified domain of the space.
defaultReplyTo
string
Default reply-to address.
trackOpens
boolean
Track opens.
trackClicks
boolean
Track clicks.
confirmAddressOnce
boolean
Confirm an address once for every list of the space. Leave false when the lists have nothing in common.
brandColor
string
Color of buttons and links, #rrggbb.
buttonColor
string
Background of email buttons, #rrggbb. An empty string goes back to the brand color.
buttonTextColor
string
Text of email buttons, #rrggbb. An empty string goes back to automatic.
logoUrl
string
Logo URL, same rules as on creation. An empty string removes the logo.
emailTheme
object
The email theme. Replaces the whole theme: a field left out goes back to its default.
curl -X PATCH https://api.kulamail.com/v1/spaces/9b8a7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d \
  -H "Authorization: Bearer ml_your_account_key" \
  -H "Content-Type: application/json" \
  -d '{ "defaultFromName": "The Daily Fern", "defaultFromEmail": "hello@dailyfern.com" }'

Email theme

Every field is optional; null or absent takes the default, the rendering of a space that never changed its design.

FieldValuesDefault
textColor, headingColor#rrggbb#1f2328; headings take the text color
linkColor#rrggbbThe brand color
backgroundColor#rrggbb, around the content#f6f6f4
contentBackgroundColor#rrggbb#ffffff
mutedColor#rrggbb, footer and small print#8a8f98
fontFamily, headingFontFamilyA font idInter, then system fonts
fontSize14 to 18 (px)16
width520 to 720 (px)600
contentStylecard or plaincard
contentRadius0 to 32 (px), corners of the card8
buttonRadiussquare, rounded or pillrounded
buttonSizesmall, medium or largemedium
logoWidth40 to 400 (px)140
logoAlignleft, center or rightcenter
showHeaderfalse hides the logotrue
socialLinksUp to 12 { "network", "url" }, shown under the footer. NetworksNone

An invalid value answers 400 invalid_theme, and the message names the field.

curl -X PATCH https://api.kulamail.com/v1/spaces/9b8a7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d   -H "Authorization: Bearer ml_your_account_key"   -H "Content-Type: application/json"   -d '{ "emailTheme": { "fontFamily": "lora", "contentStyle": "plain", "buttonRadius": "pill" } }'

Get the reputation of a space

GET /v1/spaces/{id}/reputation

Raw numbers of the last 7 days, to show your customers or watch their spaces. Rates are fractions (0.004 = 0.4 %), null when nothing was sent.

{
  "from": "2026-10-12T09:30:00Z",
  "to": "2026-10-19T09:30:00Z",
  "sent": 12480,
  "hardBounces": 31,
  "hardBounceRate": 0.0025,
  "complaints": 2,
  "complaintRate": 0.0003,
  "gmailOpens": { "delivered": 5210, "opened": 1980, "openRate": 0.38 },
  "otherOpens": { "delivered": 6950, "opened": 2920, "openRate": 0.42 },
  "contactsUnderReview": 340,
  "reputationStatus": "OK",
  "marketing": { "paused": false, "pausedAt": null, "pausedReason": null, "pausedDetail": null }
}
FieldMeaning
complaints, complaintRateOutside Gmail, which doesn't report complaints one by one
gmailOpens, otherOpensHuman opens at Gmail and at the other identified providers. Machine opens are left out
contactsUnderReviewActive contacts with no open, click or confirmed subscription yet. Contacts under review
reputationStatusOK, WATCH or ALERT. Reputation
marketing.pausedReasonACCOUNT (paused by you), or REPUTATION, SES_TENANT_PAUSED, MANUAL (paused by Kula)

A Gmail open rate well below the other providers often means your emails land in Gmail's spam folder.

Get the reputation of every space

GET /v1/spaces/reputation

The same numbers for every space of the account in one call, to watch hundreds of spaces without hitting the rate limit. Spaces in the mode of the key, oldest first. Not paginated: the response holds every space.

Each entry has the fields of the reputation of a space, computed the same way, plus spaceId and externalId. from and to are given once for the whole response.

{
  "from": "2026-10-12T09:30:00Z",
  "to": "2026-10-19T09:30:00Z",
  "spaces": [
    {
      "spaceId": "9b8a7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "externalId": "blog_42",
      "sent": 12480,
      "hardBounces": 31,
      "hardBounceRate": 0.0025,
      "complaints": 2,
      "complaintRate": 0.0003,
      "gmailOpens": { "delivered": 5210, "opened": 1980, "openRate": 0.38 },
      "otherOpens": { "delivered": 6950, "opened": 2920, "openRate": 0.42 },
      "contactsUnderReview": 340,
      "reputationStatus": "OK",
      "marketing": { "paused": false, "pausedAt": null, "pausedReason": null, "pausedDetail": null }
    }
  ]
}

Pause and resume marketing

POST /v1/spaces/{id}/marketing/pause

Campaigns and flows of the space wait; queued emails leave once you resume. Transactional emails keep flowing. Optional body: { "reason": "Customer unpaid" }, 500 characters at most. Answers 409 if marketing is already paused.

POST /v1/spaces/{id}/marketing/resume

Lifts a pause you made (ACCOUNT). A pause by Kula answers 409 paused_by_kula: contact support. If Kula pauses a space you had paused, Kula's pause replaces yours.

Both return the marketing object above.

Delete a space

DELETE /v1/spaces/{id}

Deletes the space and everything in it: domains, contacts, lists, campaigns, flows and keys. Irreversible. Answers 204, or 400 for the last live space of the account.