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.
  • 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.
  • TrackingGuidesOpens and clicks: one record, two toggles, and what an open really means.
  • 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.
  • 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.
  • 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.
  • 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.
  • IntegrationsGuidesVercel, Netlify and Cloudflare, plus Zapier and n8n for workflows without code.
  • 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.
  • n8nGuidesThe Rasket node and trigger for n8n workflows: install, connect, every operation.
  • 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.
  • 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.

API referenceAI helpers

AI

Subject lines, a first draft, and an explanation of what happened to an email — the dashboard's three AI helpers, over the API.

Who can call it

What each credential can reach on the AI routes
CredentialAll three routes
full_access200
sending_access401 restricted_api_key
OAuth token with ai:use200
OAuth token without ai:use403 invalid_permission

What is sent to the model and what is kept is described in the AI assist guide. A recipient's address is never part of it.

Refusals, in order

A request that passes authentication is checked in this order, so the first to fail is the one you see:

  1. AI assist is not configured for the account: 503 service_unavailable, "AI assist is not available on this account." Nothing is recorded and no credit is spent; there is nothing to turn on at your end.
  2. AI assist is off for the team: 403 invalid_permission, "AI assist is off for this team. A team admin can turn it on in Settings." Turn it on with PATCH /team and ai_assist_enabled: true.
  3. The month's credits are spent: 422 validation_error, "AI credits for this month are used up." Every answer carries credits_remaining, so you can stop before this.
  4. More than 10 AI requests in a minute, per team: 429 rate_limit_exceeded.

An accepted request spends one credit. A request that fails on our side costs nothing, and a diagnosis read back for an email that has not changed costs nothing either. Nor does a diagnosis of an email that failed on our mail servers' side: it comes back with cause: "provider_failure" and the recorded reason.

Endpoints

Suggest subject lines

POST /ai/subject-lines

Subject lines for an email you describe. Nothing is saved.

Body

  • subjectstring

    The current subject, if any.

  • htmlstring

    The HTML body, up to 100,000 characters.

  • textstring

    The plain-text body, up to 100,000 characters.

  • audiencestring

    Who the email is for, up to 2,000 characters.

1 more field (template_id)
  • template_idstring

    One of the team's templates, recorded as what the request was about. The content still comes from this body.

Request

curl -X POST "https://api.rasket.com/ai/subject-lines" \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "User-Agent: acme-billing/1.0" \
  -H "Content-Type: application/json" \
  -d '{
  "subject": "Our November update",
  "text": "Three new features and a price freeze.",
  "audience": "Customers on the Pro plan"
}'

Response 200

{
  "object": "ai_subject_suggestions",
  "suggestions": ["Three new features, and your price stays put", "November: what's new on your Pro plan"],
  "credits_remaining": 87,
  "credits": {
    "limit": 100,
    "used": 13,
    "remaining": 87
  }
}
  • Refused in this order: AI assist not configured for the account is 503 service_unavailable and costs nothing, AI assist off for the team is 403 invalid_permission, the month's credits spent is 422 validation_error, and more than 10 AI requests a minute is 429 rate_limit_exceeded.
  • An accepted request spends one credit.

Draft an email body

POST /ai/draft

An HTML and plain-text body from a brief, or a rework of a draft.

Body

  • briefstringRequired

    What the email should say, up to 2,000 characters.

  • tonestring

    neutral, friendly or formal.

  • existing_htmlstring

    A draft to rework instead of starting fresh, up to 100,000 characters.

1 more field (template_id)
  • template_idstring

    One of the team's templates, recorded as what the request was about.

Request

curl -X POST "https://api.rasket.com/ai/draft" \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "User-Agent: acme-billing/1.0" \
  -H "Content-Type: application/json" \
  -d '{
  "brief": "Welcome a new customer and point them at the quickstart.",
  "tone": "friendly"
}'

Response 200

{
  "object": "ai_draft",
  "html": "<p>Welcome aboard! …</p>",
  "text": "Welcome aboard! …",
  "credits_remaining": 86,
  "credits": {
    "limit": 100,
    "used": 14,
    "remaining": 86
  }
}
  • Refused in this order: AI assist not configured for the account is 503 service_unavailable and costs nothing, AI assist off for the team is 403 invalid_permission, the month's credits spent is 422 validation_error, and more than 10 AI requests a minute is 429 rate_limit_exceeded.
  • There is no subject in the answer: ask for subject lines separately. Nothing is saved or sent.

Diagnose an email

POST /emails/{email_id}/diagnose

What happened to one email, its likely causes, and what to do next.

Path parameters

  • email_idstringRequired

    The email's ID.

Request

curl -X POST "https://api.rasket.com/emails/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/diagnose" \
  -H "Authorization: Bearer $RASKET_API_KEY" \
  -H "User-Agent: acme-billing/1.0"

Response 200

{
  "object": "ai_diagnosis",
  "summary": "Email 4ef9a417-02e9-4d39-ad75-9611e0fcc33c bounced permanently at one recipient domain.",
  "likely_causes": ["The mailbox does not exist at the receiving domain."],
  "next_steps": ["Remove the address, or confirm it with the recipient."],
  "cause": null,
  "created_at": "2026-09-12T10:00:00.000Z",
  "stored": false,
  "credits_remaining": 85,
  "credits": {
    "limit": 100,
    "used": 15,
    "remaining": 85
  }
}
  • Refused in this order: AI assist not configured for the account is 503 service_unavailable and costs nothing, AI assist off for the team is 403 invalid_permission, the month's credits spent is 422 validation_error, and more than 10 AI requests a minute is 429 rate_limit_exceeded.
  • The model sees recipient domains, statuses and the event timeline — never a recipient's address or the body.
  • A diagnosis already made for the same state of the email comes back with stored: true and costs nothing.
  • An email that failed on our mail servers' side comes back with cause: "provider_failure": the recorded reason and what to do, with no credit spent.