Skip to content
Esc
  • OverviewGuidesWhat exists today, and where to start.
  • QuickstartGuidesKey, domain, first send — in that order.
  • AuthenticationGuidesBearer keys, the mandatory User-Agent, and what each refusal means.
  • ErrorsGuidesThe whole vocabulary, with the status each name carries.
  • IdempotencyGuidesRetry a send without sending it twice.
  • PaginationGuidesCursors are item IDs, not page numbers.
  • Rate limitsGuidesTen a second per team, and the headers that tell you where you are.
  • Sending newslettersGuidesUse a campaign, or include an unsubscribe link.
  • EventsGuidesEvery event a webhook can carry, with one real payload each.
  • DomainsGuidesThe records, where they go at each registrar, and what the page does while you wait.
  • Address verificationGuidesDon't send to addresses that don't exist, and verify a list before you mail it.
  • TrackingGuidesOpens and clicks: one record, two toggles, and what an open really means.
  • Sign-up formsGuidesPop-ups and embedded forms on your site, and the rules that pick one.
  • Website trackingGuidesrasket.js on your own site: the snippet, consent, three events and the check.
  • TemplatesGuidesFifty-seven starters sorted by goal, and how to keep a campaign as a template.
  • ReceivingGuidesInbound mail, and the Inbox: a webhook fires, you read it, you answer it.
  • InboxGuidesChannels, personal mailboxes and seats: who sees what, and where a reply goes.
  • Mail appsGuidesComing soon: your Rasket address in Apple Mail, Outlook and the Gmail app.
  • Inbox APIGuidesOpen, read and answer support conversations from your app, with the same key.
  • Support inbox in your appGuidesA Contact us form that opens a conversation your team answers, in five minutes.
  • Replies to your emailsGuidesOne field on a send, and the customer's reply opens a conversation.
  • Let an agent triageGuidesAn AI agent reads, notes and drafts over MCP; a person sends.
  • Node SDKGuidesThe rasket package: typed from the API's own document, retries only what is safe.
  • Python SDKGuidesThe rasket package on PyPI: the Node client's methods, in snake_case, over httpx.
  • Go SDKGuidesThe rasket-go module: the Node client's methods in Go, standard library only.
  • PHP SDKGuidesThe rasket/rasket-php package: the Node client's methods over curl, typed for PHPStan.
  • Ruby SDKGuidesThe rasket gem: the Node client's methods in snake_case, with RBS signatures.
  • Java SDKGuidesThe com.rasket:rasket-java package: the Node client's methods for Java 11+, no dependencies.
  • .NET SDKGuidesThe Rasket NuGet package: the Node client's methods as async C#, no dependencies.
  • Rust SDKGuidesThe rasket crate: the Node client's methods as async Rust on reqwest and serde.
  • Any languageGuidesGo, PHP, Ruby, Java, C#, Rust, Elixir and curl: one tested program each.
  • MCP serverGuidesConnect Claude, ChatGPT or any MCP client: your scopes, no key.
  • AI assistGuidesSubject lines, drafts and diagnosis — in the dashboard and over the API, off until you allow it.
  • AgentsGuidesLet an AI agent set Rasket up: the skill, the rules file, MCP, and the recipe they share.
  • AI coding agentsGuidesRules for AGENTS.md, CLAUDE.md and Cursor that point a coding agent at Rasket.
  • OAuthGuidesLet another app act for a team: register, authorize with PKCE, exchange, refresh.
  • Single sign-onGuidesOIDC login for your team, a domain proved by DNS, enforcement and break-glass.
  • IntegrationsGuidesEvery integration and its status, and Rasket on Vercel, Netlify and Cloudflare.
  • SMTPGuidesSend from anything that speaks SMTP: settings, setup guides, limits and replies.
  • ZapierGuidesSend email, add contacts and react to email events from a Zap, with no code.
  • n8nGuidesComing soon: the Rasket node and trigger for n8n workflows.
  • VercelGuidesAdd Rasket on Vercel: a Sending key in each project as RASKET_API_KEY, no copying.
  • WordPressGuidesComing soon: the Rasket plugin, sending every email your site sends.
  • NotionGuidesTurn a Notion database of people into contacts in a segment, once or every hour.
  • Migrating to RasketGuidesBring contacts, unsubscribes, lists and templates from Mailchimp, Klaviyo and more.
  • Switching providersGuidesChange the base URL and key; what works unchanged, and what differs.
  • PipedreamGuidesComing soon: Rasket actions and instant sources for Pipedream workflows.
  • FramerGuidesComing soon: the Rasket plugin for sign-up forms on a Framer site.
  • MakeGuidesComing soon: send email and texts, and react to their events from a Make scenario.
  • monday.comGuidesComing soon: turn monday.com board items into contacts.
  • ClickUpGuidesComing soon: ready-made Zapier and Make automations for ClickUp tasks.
  • HubSpotGuidesComing soon: keep HubSpot contacts and lists in step with Rasket.
  • WebflowGuidesComing soon: Webflow form submissions as contacts, orders as store events.
  • WixGuidesComing soon: Wix contacts, carts and orders as store flows.
  • SlackGuidesComing soon: email alerts in the Slack channels you choose.
  • Google SheetsGuidesComing soon: turn a sheet tab of people into contacts in a segment.
  • AirtableGuidesComing soon: turn an Airtable table of people into contacts in a segment.
  • ShopifyGuidesComing soon: Rasket for Shopify, with customers, store events and flows.
  • SupabaseGuidesComing soon: connect Supabase and send its Auth emails from your own domain.
  • SMS quickstartGuidesSend your first text to a US or Canadian phone.
  • Get a numberGuidesToll-free or local numbers, and the registration carriers require.
  • Consent and STOPGuidesWho you may text, the proof you keep, and replies like STOP.
  • SMS campaignsGuidesText a segment, at a local time, priced before you send.
  • Texts in automationsGuidesThe Send SMS step, and what happens to a contact without a phone.
  • SMS webhooksGuidesThe six sms events and what each one carries.
  • SMS pricingGuidesTexts included in each plan, the price per message, and number fees.
  • EmailsAPI referenceSend, batch, retrieve, list, reschedule, cancel, attachments.
  • DomainsAPI referenceAdd a domain, publish its records, verify it.
  • API keysAPI referenceCreate, list, rename and revoke credentials.
  • WebhooksAPI referencePayloads, signature verification, retries and replay.
  • SuppressionsAPI referenceAddresses we will not send to, and why.
  • LogsAPI referenceEvery request made with this team's credentials.
  • MetricsAPI referenceDelivery, bounce, complaint and engagement counts.
  • TemplatesAPI referenceVersioned email content with typed variables, addressed by ID or alias.
  • ContactsAPI referenceYour audience: contacts, their typed properties, segments and topic choices.
  • SegmentsAPI referenceAudiences defined by a filter, by hand, or both.
  • TopicsAPI referenceWhat contacts subscribe to, and the preference page's list.
  • CampaignsAPI referenceCampaigns, at /broadcasts: one message to a segment, from draft to results.
  • AutopilotAPI referenceStore campaigns Autopilot drafts for you, each waiting for a yes or a skip.
  • ImportsAPI referenceCSV uploads: column mapping, conflicts and counts.
  • AutomationsAPI referenceWorkflows that run per contact: the graph, its versions, and every run.
  • Custom eventsAPI referenceThe names your product fires, and what starts a workflow.
  • ReceivingAPI referenceMail sent to you: the message, its attachments, its raw source.
  • OAuthAPI referenceClient registration, the token endpoint, and the grants a team has given.
  • TeamAPI referenceThe team a credential belongs to: its plan, sender identity, AI flag and members.
  • BillingAPI referencePlan, usage, invoices and add-ons, and the hosted pages where a customer pays.
  • AI helpersAPI referenceSubject lines, a first draft, and why an email did what it did.
  • InboxAPI referenceChannels, conversations, messages, notes and search in your support inbox.
  • SMSAPI referenceSend, schedule and cancel texts, numbers, test phones and SMS consent.

GuidesRust SDK

Rust SDK

rasket: an async, typed client for Rust 1.88 and later, on tokio. Its types and methods are generated from the same document the API is validated against, so it has the Node client's methods and cannot drift from them.

The rasket crate is not published yet. There is nothing to install from crates.io yet. Until there is, call the REST API with any HTTP client, as below, or connect an agent over MCP. The rest of this page describes the client as it will ship.

Today: the REST API

Every endpoint in the API reference has a cURL tab. This is the first send:

curl -X POST "https://api.rasket.com/emails" \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "User-Agent: acme-billing/1.0" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042" \
  -d '{
  "from": "Acme <orders@send.acme.example>",
  "to": ["ronald.williams@example.com"],
  "subject": "Your order has shipped",
  "html": "<p>Order 1042 left the warehouse this morning.</p>"
}'

The first send

use rasket::{Client, RequestOptions, SendEmailRequest};

#[tokio::main]
async fn main() -> Result<(), rasket::Error> {
    let client = Client::builder(std::env::var("RASKET_API_KEY").unwrap_or_default())
        .user_agent("acme-billing/1.0")
        .build()?;
    let sent = client
        .emails
        .send(
            &SendEmailRequest {
                from: Some("Acme <billing@acme.example>".into()),
                to: "ronald.williams@example.com".into(),
                subject: Some("Your receipt".into()),
                html: Some("<p>Thanks.</p>".into()),
                ..Default::default()
            },
            Some(RequestOptions::new().idempotency_key("receipt-1042")),
        )
        .await?;
    println!("{}", sent.body.id);
    Ok(())
}

The client sends a User-Agent of its own on every request, because a request without one is refused; what you pass as .user_agent(…) is appended to it. Keys start with rk_, and an OAuth access token works wherever a key does. On a deployment host, set .base_url(…) to https://<deployment-host>/api/v1.

What every call returns

let result = client.emails.get(&email_id, None).await?;

let body = result.body; // the parsed body, typed per route (rasket::Email here)
let rate_limit = result.rate_limit; // Some(RateLimit { limit: 10, remaining: .., reset_seconds: .. })
let request_id = result.request_id; // the x-request-id to quote
let replayed = result.idempotent_replayed; // true on a replay of an earlier keyed request

One shape for every method. For a list route, the body is the { object, has_more, data } envelope described under pagination.

The same methods as the Node SDK

This client covers emails (sent and received), batch sends, domains, contacts, segments, broadcasts, webhooks and suppressions: every method the Node SDK has for them. Methods are in snake_case on namespace fields (client.emails.receiving). Each takes path parameters as &str, then the body (&T) or query (Option<&T>), then Option<RequestOptions>, and is async. Optional fields are Options, and a field the API lets you clear is a rasket::Nullable: Nullable::Null sends null.

Method names in the Node and Rust clients
NodeRust
emails.sendclient.emails.send(&body, options).await
webhooks.rotateSecretclient.webhooks.rotate_secret(webhook_id, options).await
domains.regenerateDkimclient.domains.regenerate_dkim(domain_id, &body, options).await
emails.receiving.attachments.listclient.emails.receiving.attachments.list(email_id, query, options).await

Every page of a list

let query = rasket::DomainsListQuery {
    limit: Some(100),
    ..Default::default()
};
let mut domains = client.domains.list_all(Some(&query), None);
while let Some(domain) = domains.next().await {
    println!("{}", domain?.name);
}

Every list method that pages has an _all twin returning a rasket::Paginator, which asks for the next page with the last item's id as after. The first error ends the walk.

Idempotency

Pass RequestOptions::new().idempotency_key(…) to emails.send, batch.send, broadcasts.sendTest or contacts.verifications.create, the routes that take one. The client sends it as it is and never makes one up: a key it invented would make a retry look safe when you never asked for that.

  • 1–256 characters, counted as the API counts them. A key outside that range is refused before any request is sent, with the same 400 invalid_idempotency_key the API would answer.
  • Scoped to your team, remembered for 24 hours.

Errors

use rasket::error_names::{RATE_LIMIT_EXCEEDED, VALIDATION_ERROR};

match client.emails.send(&email, None).await {
    Ok(sent) => println!("{}", sent.body.id),
    Err(rasket::Error::Api(error)) if error.name == VALIDATION_ERROR => {
        reject(error.errors.unwrap_or_default()); // Vec<rasket::ValidationIssue>
    }
    Err(rasket::Error::Api(error)) if error.name == RATE_LIMIT_EXCEEDED => {
        later(error.rate_limit.and_then(|limit| limit.retry_after_seconds));
    }
    // error.reason is Network or Timeout: no answer arrived
    Err(rasket::Error::Connection(error)) => unreachable_api(error.reason),
    Err(other) => return Err(other),
}

The error's name is the API's stable vocabulary, the names the errors page lists, and the client carries each as a constant. The one value outside it is unknown_error: the response had no error body of ours.

Retries

Only what is safe to repeat is retried: a GET, or a request with an idempotency key. Those are retried when no answer came, on a 429 that is not a quota, on a 5xx other than 501, and on 409 concurrent_idempotent_requests. retry-after is obeyed, and a value above the longest wait is not waited for: the error comes back at once.

let client = rasket::Client::builder(api_key)
    .timeout(Duration::from_secs(30))
    .retry(3, Duration::from_millis(500), Duration::from_secs(8))
    .build()?;

.retry(1, Duration::ZERO, Duration::ZERO) turns retrying off. The timeout applies to each attempt, answer body included; drop the future to stop the whole call.

Verifying a webhook

// headers: the request's http::HeaderMap; body: its raw bytes, before anything decodes them.
let secret = std::env::var("RASKET_WEBHOOK_SECRET").unwrap_or_default();
match rasket::webhook::verify(&body, &headers, &secret) {
    Ok(event) => handle(event),
    Err(error) => refuse(error.reason.as_str()),
}

The signature covers the raw request body. Take the body as bytes before anything decodes it, and pass those. client.webhooks.verify is the same check; rasket::webhook::verify_at takes the time to measure the window against.

Worth knowing

  • Client is cheap to clone and safe to share across tasks; pass your own reqwest::Client with .http_client(…).
  • rasket::Error is #[non_exhaustive]: match the variants you handle and keep a catch-all arm.
  • Timestamps are ISO 8601 UTC with milliseconds, as strings.
  • webhooks.get returns the signing secret masked. It is in the create and rotate_secret responses and nowhere else.

Other languages

The same client, generated from the same document, in Node.js, Python, Go, PHP, Ruby, Java and .NET.