Contacts
{contact} is the contact id or the email address (URL-encoded): /v1/contacts/ada%40example.com. Contacts explained.
The contact object
{
"id": "0d9e8f7a-6b5c-4d3e-2f1a-0b9c8d7e6f5a",
"email": "ada@example.com",
"firstName": "Ada",
"lastName": "Lovelace",
"attributes": {
"plan": "pro",
"company": "Analytical Engines",
"seats": 12,
"trial": false
},
"status": "ACTIVE",
"source": "API",
"mailboxProvider": "GOOGLE",
"underReview": false,
"createdAt": "2026-09-02T10:15:00Z",
"lastSentAt": "2026-10-15T08:00:12Z",
"lastOpenedAt": "2026-10-15T09:12:40Z",
"lastClickedAt": null
}
| Field | Values |
|---|---|
status | UNCONFIRMED (signed up with double opt-in, not confirmed yet: receives no marketing), ACTIVE, UNSUBSCRIBED (from everything), BOUNCED, COMPLAINED |
source | How the contact arrived: FORM, API, IMPORT, DASHBOARD, MCP |
mailboxProvider | Who hosts the inbox, found from the domain's MX records: GOOGLE, MICROSOFT, YAHOO, AOL, APPLE, OTHER, UNKNOWN |
underReview | true for a contact who has not opened, clicked or confirmed yet |
Attributes
Data to personalize emails ({{ contact.plan }}) or filter segments.
- Up to 50 attributes per contact.
- Keys: 1 to 50 lowercase letters, digits or underscores.
email,first_nameandlast_nameare reserved: use the contact fields. - Values: string (1,000 characters at most), number, boolean or
null. Lists and objects are refused. Types are kept, so"seats": 12can be compared withgreater_than. - Updates are merged: send only the keys that change. A
nullvalue removes the key.
List contacts
GET /v1/contacts
Newest first.
UNCONFIRMED, ACTIVE, UNSUBSCRIBED, BOUNCED or COMPLAINED.subscription to the list.listId: only PENDING, SUBSCRIBED or UNSUBSCRIBED members.0.curl "https://api.kulamail.com/v1/contacts?listId=5a8e…&size=100" \
-H "Authorization: Bearer ml_your_api_key"
{
"contacts": [
{
"id": "0d9e8f7a-…",
"email": "ada@example.com",
"…": "…",
"subscription": {
"listId": "5a8e…",
"listName": "Product updates",
"status": "SUBSCRIBED",
"source": "API",
"subscribedAt": "2026-10-17T09:30:00Z",
"unsubscribedAt": null
}
}
],
"page": 0,
"size": 100,
"total": 1284,
"totalPages": 13
}
Create or update a contact
POST /v1/contacts
Creates the contact, or updates it if the address already exists in the space.
firstName.true sends a confirmation email first: subscriptions stay PENDING until the person clicks the link. In a space that confirms an address once, a contact already subscribed to another list is subscribed at once, unless they left this list before. Default false.doubleOptIn: true only. Your page, shown once the confirmation is recorded, instead of Kula's. Absolute https URL, 1000 characters at most, used exactly as given.curl https://api.kulamail.com/v1/contacts \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"email": "ada@example.com",
"firstName": "Ada",
"attributes": { "plan": "trial", "signup_date": "2026-10-17" },
"listIds": ["5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f"]
}'
const response = await fetch('https://api.kulamail.com/v1/contacts', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.KULA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: user.email,
firstName: user.firstName,
attributes: { plan: 'trial', signup_date: '2026-10-17' },
listIds: [PRODUCT_UPDATES_LIST_ID]
})
})
const contact = await response.json()
Returns the contact object: 201 when created, 200 when updated.
A subscription without double opt-in is active at once: it starts the flows triggered by this list and sends the contact.subscribed webhook.
With double opt-in, one confirmation email covers every list of the request. It names each list with its description; its subject is "Confirm your subscription to" and the list name, or "Confirm your subscription" for several lists. A contact created by the call is UNCONFIRMED until the person clicks, then ACTIVE. A PENDING subscription not confirmed within 30 days is removed, and a contact created by the API with nothing else attached (no other subscription, event or email) is deleted with it.
Redirect after confirmation
With confirmationRedirectUrl, the confirmation link sends the person to your page, for example to sign them in:
{
"email": "ada@example.com",
"listIds": ["5a8e…"],
"doubleOptIn": true,
"confirmationRedirectUrl": "https://app.example.com/welcome?token=8f2c…"
}
- Kula adds nothing to the URL and changes nothing in it.
- The redirect only happens when the link is valid. An invalid link shows Kula's page. Clicking a valid link again redirects again.
- A token in the URL shows up in the browser history and in your server logs: make it single-use and short-lived.
- At most one confirmation email goes out per subscription every 15 minutes. A call made within that window sends no email, so its redirect is ignored: the email already sent keeps its own.
- An already active subscription gets no email, so no redirect either. Nor does a contact already subscribed to another list, in a space that confirms an address once: they are subscribed at once, and the
contact.subscribedwebhook tells you so. - When confirmations go unconfirmed, double opt-in calls are refused for a few hours. Bot signups.
| Status | Code | When |
|---|---|---|
| 400 | validation_error, bad_request | Invalid address, attributes, a domain that cannot receive email, or an invalid confirmationRedirectUrl or one sent without doubleOptIn |
| 400 | disposable_address | A new contact with a disposable address (mailinator.com, yopmail.com…) |
| 404 | not_found | A list in listIds does not exist |
| 409 | contact_unreachable | Subscribing an address that bounced or reported spam |
| 429 | confirmations_on_hold | A doubleOptIn: true call while the double opt-in signups of the space are paused. The message gives the time to try again |
Create or update a batch of contacts
POST /v1/contacts/batch
Creates or updates up to 100 contacts in one request, to keep another tool in sync. The body is an array of contacts, each with the fields of Create or update a contact plus:
true unsubscribes the contact from everything: its status becomes UNSUBSCRIBED. Not with listIds.A batch never subscribes again a contact who unsubscribed, nor a subscription that is UNSUBSCRIBED, even with doubleOptIn: a resync cannot undo an unsubscribe. Such lists come back in skipped, the other fields are updated. To bring someone back on their request, use Subscribe to a list.
Otherwise the rules are those of a single call: new subscriptions start the flows of their list and send the contact.subscribed webhook, unsubscribes send contact.unsubscribed, and new contacts are under review like any other.
Each contact is accepted or refused on its own, results come back in the order of the request, and the batch counts as one request for the rate limits.
curl https://api.kulamail.com/v1/contacts/batch \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-d '[
{ "email": "ada@example.com", "firstName": "Ada", "listIds": ["5a8e…", "7c1d…"] },
{ "email": "grace@example.com", "unsubscribed": true },
{ "email": "not-an-address" }
]'
{
"data": [
{
"index": 0, "id": "0d9e8f7a-…", "email": "ada@example.com", "created": false, "status": "ACTIVE",
"subscriptions": [ { "listId": "7c1d…", "status": "SUBSCRIBED" } ],
"skipped": [ { "listId": "5a8e…", "reason": "unsubscribed" } ]
},
{
"index": 1, "id": "4b2a…", "email": "grace@example.com", "created": false, "status": "UNSUBSCRIBED",
"subscriptions": [ { "listId": "7c1d…", "status": "UNSUBSCRIBED" } ], "skipped": []
},
{ "index": 2, "subscriptions": [], "skipped": [], "error": "bad_request", "message": "Enter a valid email address" }
]
}
A refused contact (error, with the codes of a single call, such as contact_unreachable for an address that bounced, or bad_request for an invalid confirmationRedirectUrl) is left unchanged. The request itself fails with 400 only when the array is empty or holds more than 100 contacts.
Get a contact
GET /v1/contacts/{contact}
The contact, its subscriptions, its activity counts, and its last 20 events and emails.
curl https://api.kulamail.com/v1/contacts/ada%40example.com \
-H "Authorization: Bearer ml_your_api_key"
{
"contact": { "id": "0d9e8f7a-…", "email": "ada@example.com", "status": "ACTIVE", "…": "…" },
"subscriptions": [
{
"listId": "5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f",
"listName": "Product updates",
"status": "SUBSCRIBED",
"source": "API",
"subscribedAt": "2026-10-17T09:30:00Z",
"unsubscribedAt": null
}
],
"counts": { "sent": 14, "opened": 9, "clicked": 3 },
"events": [
{ "id": "e1f2…", "name": "trial_started", "properties": { "plan": "pro" }, "occurredAt": "2026-10-17T09:31:00Z" }
],
"messages": [
{
"id": "8f6c2a1e-…",
"subject": "Welcome to Acme",
"source": "FLOW",
"status": "DELIVERED",
"sentAt": "2026-10-17T09:31:05Z",
"openedAt": "2026-10-17T09:40:00Z",
"clickedAt": null
}
]
}
Update a contact
PATCH /v1/contacts/{contact}
Changes the address, names and attributes. Fields left out stay as they are; attributes are merged.
null removes a key.curl -X PATCH https://api.kulamail.com/v1/contacts/ada%40example.com \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "attributes": { "plan": "pro", "trial": null } }'
Returns the updated contact object.
A contact whose old address bounced can receive emails again at the new one. A contact who unsubscribed or reported spam keeps that status.
| Status | Code | When |
|---|---|---|
| 400 | validation_error, bad_request | Invalid address or attributes, or a domain that cannot receive emails |
| 400 | disposable_address | The new address is disposable |
| 409 | email_taken | Another contact of the space has the new address |
| 409 | address_suppressed | The new address is on the suppression list |
Get a preferences link
GET /v1/contacts/{contact}/preferences-url
A link to the contact's preferences page, where they choose their lists or unsubscribe. Put it in your app's settings, such as a "Manage emails" button.
curl https://api.kulamail.com/v1/contacts/ada%40example.com/preferences-url \
-H "Authorization: Bearer ml_your_api_key"
{
"url": "https://link.acme.com/p/c/QzFhYjJjM2Q0ZTVmNjc4OTBhYmNkZWYxMjM0NTY3ODk",
"expiresAt": "2026-11-16T09:30:00Z"
}
- Anyone with the link can change the contact's subscriptions, so it expires after 7 days. Ask for a new link each time you show it, don't store it.
- The page shows the public lists of the space. It lives on the tracking domain of your default sender, or of your oldest verified domain.
- Answers
409 no_verified_domainwhen the space has no verified domain yet.
Delete a contact
DELETE /v1/contacts/{contact}
Deletes the contact, its subscriptions and its events. Its sent emails stay in your reports without the address. Answers 204.
A suppressed address stays on the suppression list after deletion.
true for a data deletion request: the address also leaves the suppression list, so it could be emailed again. With an email address in the path, works even when the address isn't a contact, such as the recipient of a transactional email. Answers 404 when there is nothing to erase.Subscribe to a list
POST /v1/contacts/{contact}/subscriptions
Also resubscribes a contact who had unsubscribed: only call it when the person asked.
true sends a confirmation email first. Default false.doubleOptIn: true only. See Redirect after confirmation.curl https://api.kulamail.com/v1/contacts/ada%40example.com/subscriptions \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "listId": "5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f" }'
{
"listId": "5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f",
"listName": "Product updates",
"status": "SUBSCRIBED",
"source": "API",
"subscribedAt": "2026-10-17T09:30:00Z",
"unsubscribedAt": null
}
status is PENDING with double opt-in, removed after 30 days without confirmation, or SUBSCRIBED for a contact already subscribed to another list of a space that confirms an address once (unless they left this one before). Answers 409 contact_unreachable for an address that bounced or reported spam.
Unsubscribe from a list
DELETE /v1/contacts/{contact}/subscriptions/{listId}
Answers 204, also when the contact was not subscribed. Flows started by this list stop for this contact.
Unsubscribe from everything
POST /v1/contacts/{contact}/unsubscribe
Unsubscribes the contact from every list: its status becomes UNSUBSCRIBED. Returns the contact object.
Transactional emails still reach an unsubscribed contact; only campaigns and flows stop.
Import contacts
POST /v1/imports
Imports up to 10,000 contacts into a list, in the background. Follow progress with Get an import.
Same rules as a dashboard CSV import (details):
- invalid addresses, role addresses (
info@,noreply@…), disposable addresses, duplicates, domains that cannot receive email and suppressed addresses are skipped; - existing contacts get their names and attributes updated, never their status: an unsubscribed contact stays unsubscribed;
- imports trigger no flow and no
contact.subscribedwebhook.
email (required), firstName, lastName, attributes, subscribedAt and status.subscribed (the default), unsubscribed (imported, not subscribed to the list), bounced or complained (skipped, and suppressed for marketing in this space), unconfirmed (skipped). Any other value fails the request with 400.2026-03-01 or 2026-03-01T09:30:00Z, UTC without a zone). The list growth counts the contact on that day instead of the import day. Ignored when the contact is already subscribed. A malformed date, a date before 2000 or in the future skips the row (invalid_subscribed_at).curl https://api.kulamail.com/v1/imports \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"listId": "5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f",
"contacts": [
{ "email": "ada@example.com", "firstName": "Ada", "attributes": { "plan": "pro" }, "subscribedAt": "2026-03-01T09:30:00Z" },
{ "email": "grace@example.com", "firstName": "Grace" }
]
}'
Returns 202 Accepted with the import object. Larger files: split them, or use the CSV route below.
Import a CSV file
POST /v1/imports/csv?listId={listId}
The CSV file is the raw request body, with Content-Type: text/csv. 50 MB at most, with a header row; columns separated by ,, ; or tabs.
Columns are recognized by their header: email, first_name / firstname, last_name / lastname and common variants, subscribed_at, status. Other columns become attributes. To override, pass a mapping parameter: a JSON object from column name to email, first_name, last_name, subscribed_at, status, attributes.<key> or ignore. A subscribed_at column follows the rules of subscribedAt above. A status column takes the values of other tools (active, cancelled, cleaned, junk…): see Coming from another tool.
curl "https://api.kulamail.com/v1/imports/csv?listId=5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f" \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: text/csv" \
--data-binary @subscribers.csv
Returns 202 Accepted with the import object. Same rules as POST /v1/imports.
Get an import
GET /v1/imports/{id}
Progress, counts, and the first 50 rejected rows. GET /v1/imports lists the last 100 imports of the space, newest first.
The import object
{
"id": "9c8b7a6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"listId": "5a8e2c1f-0b3d-4e6a-9f7c-2d1e8b4a6c3f",
"fileName": null,
"status": "COMPLETED",
"columnMapping": {},
"totalRows": 2,
"processedRows": 2,
"createdCount": 1,
"updatedCount": 0,
"invalidSyntaxCount": 0,
"invalidDomainCount": 0,
"duplicateCount": 0,
"suppressedCount": 0,
"roleCount": 1,
"disposableCount": 0,
"unsubscribedCount": 0,
"bouncedCount": 0,
"complainedCount": 0,
"unconfirmedCount": 0,
"unknownStatusCount": 0,
"invalidSubscribedAtCount": 0,
"errorSample": [
{ "row": 2, "email": "info@example.com", "reason": "role_address" }
],
"errorMessage": null,
"createdVia": "API",
"createdAt": "2026-10-17T09:30:00Z",
"startedAt": "2026-10-17T09:30:01Z",
"completedAt": "2026-10-17T09:30:02Z"
}
status goes PENDING → PROCESSING → COMPLETED, or FAILED with an errorMessage. Rejection reasons: invalid_syntax, role_address, disposable, invalid_subscribed_at, duplicate, invalid_domain, previous_bounce, previous_complaint, unconfirmed, unknown_status, suppressed. unsubscribedCount counts rows imported as unsubscribed: they are part of createdCount and updatedCount.