MailKite.Methods (MailKite v0.13.0)

Copy Markdown View Source

HTTP method surface, generated from the API spec. Each function takes the client first.

Summary

Functions

Add contacts (by id, ctr_…) to a list. Returns how many were newly added; contacts already on the list are ignored.

Send a message to one of your inbox agents and get its reply. Defaults to the account's default agent; pass routeId or address to target a specific agent, or model to override the model. This is separate from inbound routing — it does not match or override routes.

Check whether a domain is available to register, and at what price. Read-only — no charge.

Create a broadcast draft. from is required; set audience to { type: "all" } or { type: "list", id: "lst_…" }. Returns the broadcast with its id (bct_…). Send it with sendBroadcast.

Add a domain. Returns the domain + DNS records.

Create a contact list. Returns the list with its id (lst_…); add contacts with addListContacts.

Create a route (match, action, destination).

Create a template. Pass baseId to clone a base template into your own, or provide name/subject/html/text/theme directly.

Delete a broadcast draft.

Remove a domain.

Delete a contact list. The list is removed; the contacts themselves are kept.

Delete an inbound routing rule by id. Pair with createRoute to register and tear down a webhook destination — e.g. an automation platform subscribing on enable and cleaning up on disable.

Remove the domain's webhook.

Get one broadcast with its status and recipient summary.

Get one domain with DNS records + webhook.

Get one contact list with its member count.

Get a message with deliveries + attachments.

Get one template (full: subject, html, text, theme). Works for your templates (tpl_…) and base templates (base_…).

List the premade base templates (light metadata). Clone one with createTemplate({ baseId }) or send from it directly via send({ templateId }).

List your broadcasts (one-to-many sends) with status and send stats.

List your domains, each with its webhook URL.

List the contacts that are members of a list, newest first. Optionally page with before (a last_seen_at/created_at cursor) and limit. Response is a bare array — paginate by passing the last row's last_seen_at (or created_at) as the next before.

List your contact lists (static, curated broadcast audiences), each with its member count.

List stored messages, newest first. Optionally filter with search (matches sender, recipient, or subject) and page with before (a received_at cursor) and limit; omit all for the default newest 100. Response is a bare array — paginate by passing the last row's received_at as the next before.

List inbound routing rules.

List your saved email templates (light metadata only — no body). Use getTemplate for the full template.

Register (buy) a domain on the customer's behalf; provisions mail DNS and adds it to the account in one call. Charges the registrar.

Remove one contact from a list (the contact itself is kept).

Re-deliver a stored message to its webhook.

Route a message to one of your registered routes (by routeId or address), running that route's action — agent, webhook, or forward. The route must already exist on your account; arbitrary destinations are not allowed.

Semantic search over the MailKite documentation — returns the most relevant doc sections for a natural-language query (hybrid vector + keyword search over https://mailkite.dev/docs). Public; no authentication required.

Send a message over a verified domain. Pass templateId (+ optional templateData) to send from a saved or base template.

Send a broadcast now, or pass an ISO 8601 scheduledAt to schedule it. A one-click unsubscribe is always added. Returns the status and resolved audience count.

Set or replace the domain's catch-all webhook.

Send a signed test event to the domain's webhook.

Edit a draft broadcast (any of from/subject/audience/html/… ). Drafts only.

Rename a contact list.

Check DNS and update status.

Functions

add_list_contacts(client, id, body)

Add contacts (by id, ctr_…) to a list. Returns how many were newly added; contacts already on the list are ignored.

agent(client, message)

Send a message to one of your inbox agents and get its reply. Defaults to the account's default agent; pass routeId or address to target a specific agent, or model to override the model. This is separate from inbound routing — it does not match or override routes.

check_domain_availability(client, domain)

Check whether a domain is available to register, and at what price. Read-only — no charge.

create_broadcast(client, body)

Create a broadcast draft. from is required; set audience to { type: "all" } or { type: "list", id: "lst_…" }. Returns the broadcast with its id (bct_…). Send it with sendBroadcast.

create_domain(client, body)

Add a domain. Returns the domain + DNS records.

create_list(client, body)

Create a contact list. Returns the list with its id (lst_…); add contacts with addListContacts.

create_route(client, body)

Create a route (match, action, destination).

create_template(client, body)

Create a template. Pass baseId to clone a base template into your own, or provide name/subject/html/text/theme directly.

delete_broadcast(client, id)

Delete a broadcast draft.

delete_domain(client, id)

Remove a domain.

delete_list(client, id)

Delete a contact list. The list is removed; the contacts themselves are kept.

delete_route(client, id)

Delete an inbound routing rule by id. Pair with createRoute to register and tear down a webhook destination — e.g. an automation platform subscribing on enable and cleaning up on disable.

delete_webhook(client, id)

Remove the domain's webhook.

get_broadcast(client, id)

Get one broadcast with its status and recipient summary.

get_domain(client, id)

Get one domain with DNS records + webhook.

get_list(client, id)

Get one contact list with its member count.

get_message(client, id)

Get a message with deliveries + attachments.

get_template(client, id)

Get one template (full: subject, html, text, theme). Works for your templates (tpl_…) and base templates (base_…).

list_base_templates(client)

List the premade base templates (light metadata). Clone one with createTemplate({ baseId }) or send from it directly via send({ templateId }).

list_broadcasts(client)

List your broadcasts (one-to-many sends) with status and send stats.

list_domains(client)

List your domains, each with its webhook URL.

list_list_contacts(client, id, opts \\ [])

List the contacts that are members of a list, newest first. Optionally page with before (a last_seen_at/created_at cursor) and limit. Response is a bare array — paginate by passing the last row's last_seen_at (or created_at) as the next before.

list_lists(client)

List your contact lists (static, curated broadcast audiences), each with its member count.

list_messages(client, opts \\ [])

List stored messages, newest first. Optionally filter with search (matches sender, recipient, or subject) and page with before (a received_at cursor) and limit; omit all for the default newest 100. Response is a bare array — paginate by passing the last row's received_at as the next before.

list_routes(client)

List inbound routing rules.

list_templates(client)

List your saved email templates (light metadata only — no body). Use getTemplate for the full template.

register_domain(client, body)

Register (buy) a domain on the customer's behalf; provisions mail DNS and adds it to the account in one call. Charges the registrar.

remove_list_contact(client, id, contact_id)

Remove one contact from a list (the contact itself is kept).

retry_delivery(client, id)

Re-deliver a stored message to its webhook.

route(client, message)

Route a message to one of your registered routes (by routeId or address), running that route's action — agent, webhook, or forward. The route must already exist on your account; arbitrary destinations are not allowed.

semantic_search(client, query)

Semantic search over the MailKite documentation — returns the most relevant doc sections for a natural-language query (hybrid vector + keyword search over https://mailkite.dev/docs). Public; no authentication required.

send(client, message)

Send a message over a verified domain. Pass templateId (+ optional templateData) to send from a saved or base template.

send_broadcast(client, id, body)

Send a broadcast now, or pass an ISO 8601 scheduledAt to schedule it. A one-click unsubscribe is always added. Returns the status and resolved audience count.

set_webhook(client, id, body)

Set or replace the domain's catch-all webhook.

test_webhook(client, id)

Send a signed test event to the domain's webhook.

update_broadcast(client, id, body)

Edit a draft broadcast (any of from/subject/audience/html/… ). Drafts only.

update_list(client, id, body)

Rename a contact list.

verify_domain(client, id)

Check DNS and update status.