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.

Guides.NET SDK

.NET SDK

Rasket: an async, typed client for .NET 8 and .NET 10, on HttpClient and System.Text.Json, trim- and AOT-safe. 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 NuGet package is not published yet. There is nothing to install from NuGet 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

using Rasket;

using var client = new RasketClient(
    Environment.GetEnvironmentVariable("RASKET_API_KEY")!,
    new RasketClientOptions { UserAgent = "acme-billing/1.0" });

var sent = await client.Emails.SendAsync(new SendEmailRequest
{
    From = "Acme <billing@acme.example>",
    To = "ronald.williams@example.com",
    Subject = "Your receipt",
    Html = "<p>Thanks.</p>",
}, new RequestOptions { IdempotencyKey = "receipt-1042" });

Console.WriteLine(sent.Body.Id);

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

What every call returns

var result = await client.Emails.GetAsync(emailId);

Email email = result.Body;                 // the parsed body, typed per route
RateLimit? limit = result.RateLimit;       // Limit (10), Remaining, ResetSeconds
string? requestId = result.RequestId;      // the x-request-id to quote
bool replayed = result.IdempotentReplayed; // 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. Every method is async and ends in Async: path parameters first, then the body or query, then RequestOptions and a CancellationToken. Optional fields are nullable, and a field the API lets you clear is an Optional<T>: Optional<string>.Null sends null, and a value converts to it implicitly.

Method names in the Node and .NET clients
Node.NET
emails.sendclient.Emails.SendAsync(body, options, ct)
webhooks.rotateSecretclient.Webhooks.RotateSecretAsync(webhookId)
domains.regenerateDkimclient.Domains.RegenerateDkimAsync(domainId, body)
emails.receiving.attachments.listclient.Emails.Receiving.Attachments.ListAsync(emailId, query)

Every page of a list

await foreach (var domain in client.Domains.ListAllAsync(new DomainsListQuery { Limit = 100 }))
{
    Console.WriteLine(domain.Name);
}

Every list method that pages has an AllAsync twin, an IAsyncEnumerable that asks for the next page with the last item's id as after. The first error ends the walk.

Idempotency

Pass new RequestOptions { IdempotencyKey = ... } 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

try
{
    await client.Emails.SendAsync(message);
}
catch (RasketApiException error) when (error.Name == ErrorNames.ValidationError)
{
    Reject(error.Errors); // [ValidationIssue { Path = ..., Message = ... }]
}
catch (RasketApiException error) when (error.Name == ErrorNames.RateLimitExceeded)
{
    Later(error.RateLimit?.RetryAfterSeconds);
}
catch (RasketConnectionException error)
{
    // error.Reason is Network or Timeout: no answer arrived
    Log(error.Reason);
}

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.

using var client = new RasketClient(apiKey, new RasketClientOptions
{
    Timeout = TimeSpan.FromSeconds(30),
    MaxAttempts = 3,
    MinRetryDelay = TimeSpan.FromMilliseconds(500),
    MaxRetryDelay = TimeSpan.FromSeconds(8),
});

MaxAttempts = 1 turns retrying off. The timeout applies to each attempt; cancel the CancellationToken to stop the whole call, which throws OperationCanceledException rather than a timeout.

Verifying a webhook

app.MapPost("/webhooks/rasket", async (HttpRequest request) =>
{
    using var buffer = new MemoryStream();
    await request.Body.CopyToAsync(buffer); // the bytes, before anything decodes them
    try
    {
        var payload = Webhook.Verify(
            buffer.ToArray(),
            name => (string?)request.Headers[name],
            Environment.GetEnvironmentVariable("RASKET_WEBHOOK_SECRET")!);
        Handle(payload);
        return Results.Ok();
    }
    catch (WebhookVerificationException)
    {
        return Results.BadRequest("invalid signature");
    }
});

The signature covers the raw request body. Copy Request.Body yourself before anything decodes it, and pass those bytes. client.Webhooks.Verify is the same check.

Worth knowing

  • Make one RasketClient and keep it: it is safe for concurrent use. Pass your own HttpClient in RasketClientOptions.HttpClient (from IHttpClientFactory, say); the client never disposes one it did not make.
  • A refusal is a RasketApiException; its Origin is ErrorSource.Client when the client refused before sending, such as an idempotency key that is too long.
  • Timestamps are ISO 8601 UTC with milliseconds, as strings.
  • webhooks.get returns the signing secret masked. It is in the CreateAsync and RotateSecretAsync responses and nowhere else.

Other languages

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