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.

GuidesGo SDK

Go SDK

github.com/Rasket-HQ/rasket-go: a typed client for Go 1.24 and later, on the standard library alone. 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-go module is not published yet. There is nothing to install from the Go module proxy 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

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/Rasket-HQ/rasket-go"
)

func main() {
	client, err := rasket.NewClient(os.Getenv("RASKET_API_KEY"), rasket.WithUserAgent("acme-billing/1.0"))
	if err != nil {
		log.Fatal(err)
	}
	sent, err := client.Emails.Send(context.Background(), rasket.SendEmailRequest{
		From:    rasket.String("Acme <billing@acme.example>"),
		To:      rasket.Recipients{"ronald.williams@example.com"},
		Subject: rasket.String("Your receipt"),
		HTML:    rasket.String("<p>Thanks.</p>"),
	}, rasket.WithIdempotencyKey("receipt-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(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 rasket.WithUserAgent is appended to it. Keys start with rk_, and an OAuth access token works wherever a key does. On a deployment host, set rasket.WithBaseURL to https://<deployment-host>/api/v1.

What every call returns

result, err := client.Emails.Get(ctx, emailID)

result.Body               // the parsed body, typed per route (rasket.Email here)
result.RateLimit          // &rasket.RateLimit{Limit: 10, Remaining: ..., ResetSeconds: ...}
result.RequestID          // the x-request-id to quote
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 takes a context.Context first, then path parameters, then the body or query struct, then options. Optional fields are pointers (rasket.String makes one), and a field the API lets you clear is a rasket.Nullable: rasket.Null sends null.

Method names in the Node and Go clients
NodeGo
emails.sendclient.Emails.Send(ctx, body, opts...)
webhooks.rotateSecretclient.Webhooks.RotateSecret(ctx, webhookID)
domains.regenerateDkimclient.Domains.RegenerateDkim(ctx, domainID, body)
emails.receiving.attachments.listclient.Emails.Receiving.Attachments.List(ctx, emailID, query)

Every page of a list

for domain, err := range client.Domains.ListAll(ctx, &rasket.DomainsListQuery{Limit: rasket.Int(100)}) {
	if err != nil {
		return err
	}
	fmt.Println(domain.Name)
}

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

Idempotency

Pass rasket.WithIdempotencyKey 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

var apiErr *rasket.APIError
var connErr *rasket.ConnectionError
switch {
case errors.As(err, &apiErr) && apiErr.Name == rasket.ErrValidationError:
	reject(apiErr.Errors) // []rasket.ValidationIssue{{Path: ..., Message: ...}}
case errors.As(err, &apiErr) && apiErr.Name == rasket.ErrRateLimitExceeded:
	later(apiErr.RateLimit.RetryAfterSeconds)
case errors.As(err, &connErr):
	// connErr.Reason is "network" or "timeout": no answer arrived
}

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.

client, err := rasket.NewClient(apiKey,
	rasket.WithTimeout(30*time.Second),
	rasket.WithRetry(3, 500*time.Millisecond, 8*time.Second),
)

WithRetry(1, 0, 0) turns retrying off. The timeout applies to each attempt; cancel the context to stop the whole call.

Verifying a webhook

func receive(w http.ResponseWriter, r *http.Request) {
	raw, err := io.ReadAll(r.Body) // the bytes, before anything decodes them
	if err != nil {
		http.Error(w, "unreadable body", http.StatusBadRequest)
		return
	}
	event, err := rasket.Verify(raw, r.Header, os.Getenv("RASKET_WEBHOOK_SECRET"))
	if err != nil {
		http.Error(w, "invalid signature", http.StatusBadRequest)
		return
	}
	handle(event)
}

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

Worth knowing

  • The client is safe for concurrent use; pass your own *http.Client with rasket.WithHTTPClient.
  • Timestamps are ISO 8601 UTC with milliseconds, as strings.
  • webhooks.get returns the signing secret masked. It is in the Create and RotateSecret responses and nowhere else.

Other languages

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