Skip to content

API reference

A JSON API over HTTPS. All paths are relative to https://stalkmail.com/api/v1. Every request needs a newsletter API key and acts only on that newsletter.

66 endpoints across 16 groups cover the core dashboard workflow: campaigns, subscribers, imports, segments, analytics, authors, domains, media, logs and API keys. Shapes may still change before general availability.

Conventions

  • Authenticate with Authorization: Bearer $STALKMAIL_API_KEY. See Authentication.
  • Every request re-verifies the newsletter owner account. A deleted account returns 401 unauthorized for API keys and 404 for public pages and forms.
  • Requests and responses are JSON, except multipart uploads.
  • Timestamps are ISO 8601 in UTC.
  • Cursor lists use limit and cursor and return pagination.nextCursor.
  • Page lists use page and perPage and return a pagination object with totals.
  • Deleting resources returns 204 No Content. Errors use the shape on the errors page.
  • Rate limits are per key and per route. Every response includes Cache-Control: no-store.
curl "https://stalkmail.com/api/v1/subscribers?limit=20" \
  -H "Authorization: Bearer $STALKMAIL_API_KEY"

Newsletter

The newsletter attached to the API key. A key only ever acts on its own newsletter.

  • GET/api/v1/newsletterNewsletter details and subscriber counts.
    Response
    {
      "data": {
        "id": "nl_…",
        "name": "The Weekly",
        "slug": "the-weekly",
        "status": "active",
        "image": "https://nyc.cloud.appwrite.io/v1/storage/buckets/newsletter-media/files/f_…/view?project=…",
        "postalAddress": "12 Example St, Lisbon"
      },
      "stats": {
        "total": 1240,
        "subscribed": 1180,
        "pending": 42,
        "unsubscribed": 18
      }
    }
  • PATCH/api/v1/newsletterUpdate general settings: name, slug, image or address.
    • Changing the slug keeps old links working through stored previousSlugs.
    • image must be a URL returned by the StalkMail media API.
    JSON body
    namestringDisplay name, 1–100 chars.
    slugstringLowercase letters, numbers and single hyphens, 3–30 chars.
    imagestringHTTPS image URL or an empty string to clear it.
    postalAddressstringMailing address shown in email footers.
    Example
    curl https://stalkmail.com/api/v1/newsletter \
      -X PATCH \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "name": "The Weekly", "postalAddress": "12 Example St, Lisbon" }'

    Rate limit: 30 requests per minute per key.

Overview

The same numbers the dashboard overview shows: KPIs, audience and engagement series, delivery health, website visits and recent activity.

  • GET/api/v1/overviewDashboard overview for a range.
    Query parameters
    rangeenum7d, 30d, 90d or 12m. Defaults to 30d.
    Response
    {
      "data": {
        "range": "30d",
        "since": "2026-10-08T00:00:00.000Z",
        "until": "2026-11-07T00:00:00.000Z",
        "kpis": {
          "subscribers": { "total": 1240, "subscribed": 1180, "newInPeriod": 94, "lostInPeriod": 12 },
          "emailsSent": 4210,
          "opened": 1590,
          "clicked": 210,
          "openRate": 0.38,
          "clickRate": 0.05
        },
        "audience": [{ "label": "Oct 8", "key": "2026-10-08", "newSubscribers": 4, "unsubscribed": 0 }],
        "engagement": [{ "label": "Oct 8", "key": "2026-10-08", "sent": 0, "opened": 0 }],
        "website": { "total": 820, "home": 300, "issues": 520, "countries": [], "devices": [], "topIssues": [], "series": [] },
        "recentCampaigns": [],
        "recentActivity": []
      }
    }

    Rate limit: 60 requests per minute per key.

Campaigns

Create drafts, edit content and send settings, preview and send. Sending runs in the background through Inngest.

  • GET/api/v1/campaignsList campaigns with cursor pagination and filters.
    Query parameters
    statusenumdraft, scheduled, sending, sent or failed.
    deliveryenumemail_web, email or web.
    visibleOnWebbooleanFilter by whether the campaign's website issue is published ("Visible on website"). true returns only campaigns visible on the public website; false returns campaigns with an unpublished issue or no issue at all.
    searchstringCase-insensitive text match.
    fromISO 8601 dateOnly include records created on or after this date.
    toISO 8601 dateOnly include records created on or before this date.
    limitintegerResults per page, 1–100. Defaults to 50.
    cursorstringOpaque cursor from pagination.nextCursor. Omit for the first page.
    Response
    {
      "data": [
        {
          "id": "cmp_…",
          "subject": "November update",
          "status": "sent",
          "delivery": "email_web",
          "audienceType": "everyone",
          "visibleOnWeb": true,
          "stats": { "sent": 1180, "delivered": 1172, "opened": 441, "clicked": 63, "bounced": 8 },
          "sentAt": "2026-11-01T09:00:00.000Z"
        }
      ],
      "pagination": { "nextCursor": null }
    }

    Rate limit: 120 requests per minute per key.

  • POST/api/v1/campaignsCreate a campaign draft, optionally with content.
    JSON body
    subjectstringEmail subject, up to 200 chars.
    previewTextstringInbox preview text, up to 200 chars.
    blocksarrayBlockNote blocks. Opaque to the API.
    coverImagestringHTTPS URL for the archive card.
    Example
    curl https://stalkmail.com/api/v1/campaigns \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "subject": "November update" }'

    Rate limit: 30 requests per minute per key.

  • GET/api/v1/campaigns/:idRetrieve one campaign with content, audience, issue and rates.
    • visibleOnWeb is true when the linked website issue is published; false for an unpublished issue or an email-only campaign.
    • Toggle the field with PATCH /api/v1/campaigns/:id/publish.
  • PATCH/api/v1/campaigns/:idUpdate content, delivery, audience or schedule.
    • Send at least one field to update.
    • Content edits on a sent campaign with a web delivery republish the linked issue in place.
    JSON body
    subjectstringEmail subject.
    previewTextstringInbox preview text.
    blocksarrayBlockNote blocks.
    coverImagestringHTTPS image URL.
    deliveryenumemail_web, email or web.
    audienceobject{ type, segmentIds, subscriberIds }.
    scheduleobject{ mode: "now" | "later", at }.

    Rate limit: 90 requests per minute per key.

  • DELETE/api/v1/campaigns/:idDelete a draft, scheduled or failed campaign.
    • Sent campaigns keep their history and stats and cannot be deleted.
    • Deleting a campaign with a published issue also removes the issue.

    Rate limit: 30 requests per minute per key.

  • POST/api/v1/campaigns/:id/sendSend now or schedule delivery.
    • Sending to the entire audience requires "confirm": true; otherwise the API returns 409 confirmation_required.
    • A campaign must have a subject and the newsletter must have a mailing address and verified from-domain.
    • Email-only audiences need at least one subscribed recipient.
    JSON body
    deliveryenumemail_web, email or web. Defaults to email_web.
    audience.typeenumeveryone, segments or contacts.
    audience.segmentIdsstring[]Required when type is segments. Up to 20.
    audience.subscriberIdsstring[]Required when type is contacts. Up to 5,000.
    schedule.modeenumnow or later. Defaults to now.
    schedule.atISO 8601 dateRequired when mode is later.
    confirmbooleanMust be true to send to the entire audience.
    Example
    curl https://stalkmail.com/api/v1/campaigns/cmp_…/send \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "delivery": "email_web",
        "audience": { "type": "segments", "segmentIds": ["seg_…"] },
        "schedule": { "mode": "later", "at": "2026-11-12T09:00:00.000Z" }
      }'
    Response
    {
      "data": {
        "scheduled": true,
        "scheduledAt": "2026-11-12T09:00:00.000Z"
      }
    }

    Rate limit: 12 requests per minute per key.

  • POST/api/v1/campaigns/:id/testSend a test rendering to one address.
    JSON body
    email*stringRecipient address.
    subjectstringOverride the subject for this test.
    previewTextstringOverride the preview text.
    blocksarrayOverride the blocks.

    Rate limit: 20 requests per minute per key.

  • POST/api/v1/campaigns/:id/duplicateCopy content into a fresh draft.
    Response
    {
      "data": {
        "id": "cmp_…",
        "status": "draft",
        "subject": "November update"
      }
    }

    Rate limit: 30 requests per minute per key.

  • GET/api/v1/campaigns/:id/previewRender the campaign HTML.
    Query parameters
    channelenumemail or web. Defaults to email.
    Response
    { "data": { "channel": "email", "html": "<!doctype html>…" } }
  • PATCH/api/v1/campaigns/:id/publishPublish or unpublish the linked website issue (the "Visible on website" toggle).
    • Only campaigns with a web delivery (web or email_web) can be published.
    • Unpublishing keeps the issue and its slug; the public URL returns 404 until republished.
    JSON body
    published*booleantrue to publish, false to unpublish.

    Rate limit: 30 requests per minute per key.

Subscribers

Manage contacts, their tags and custom field values, and import CSVs. Subscriber ids are stable hashes and an email cannot be changed once created.

  • GET/api/v1/subscribersList subscribers with cursor pagination, search and filters.
    Query parameters
    statusenumpending, subscribed, unsubscribed or bounced.
    cleanupenumactive, waiting, dormant or stopped.
    sourceenummanual, csv, api or form.
    tagIdstringOnly contacts carrying this tag.
    emailstringEmail prefix match, case-insensitive.
    fromISO 8601 dateOnly include records created on or after this date.
    toISO 8601 dateOnly include records created on or before this date.
    limitintegerResults per page, 1–100. Defaults to 50.
    cursorstringOpaque cursor from pagination.nextCursor. Omit for the first page.
    Response
    {
      "data": [
        {
          "id": "…",
          "email": "reader@example.com",
          "name": "Alex Reader",
          "status": "subscribed",
          "source": "api",
          "tags": ["tag_…"],
          "fields": { "company": "Acme" },
          "stats": { "emailsReceived": 12, "opens": 7, "clicks": 2 },
          "createdAt": "2026-01-04T10:00:00.000Z"
        }
      ],
      "pagination": { "nextCursor": "…" }
    }

    Rate limit: 240 requests per minute per key.

  • POST/api/v1/subscribersAdd a subscriber.
    • Duplicates return 409 conflict; existing or unsubscribed contacts are never silently resubscribed.
    • Contacts who reported spam return 409 complained.
    • Domains marked undeliverable by list cleanup return 422 validation_error.
    JSON body
    email*stringValid email address.
    namestringDisplay name, up to 120 chars.
    statusenumsubscribed or pending. Defaults to subscribed.
    locationstringFree-text location, up to 120 chars.
    tagIdsstring[]Tag ids to attach.
    fieldsobjectCustom field values keyed by field key.
    Example
    curl https://stalkmail.com/api/v1/subscribers \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "email": "reader@example.com", "name": "Alex Reader", "tagIds": ["tag_…"] }'

    Rate limit: 120 requests per minute per key.

  • GET/api/v1/subscribers/:idRetrieve one subscriber.
  • PATCH/api/v1/subscribers/:idUpdate name, status, location, tags or custom fields.
    • The email address cannot be changed because the document id is derived from it.
    • Setting status to subscribed on a contact who reported spam returns 409 complained.
    JSON body
    namestringDisplay name. Empty string clears it.
    statusenumpending, subscribed, unsubscribed or bounced.
    locationstringFree-text location.
    tagIdsstring[]Replaces the contact's tags.
    fieldsobjectReplaces stored custom field values.
  • DELETE/api/v1/subscribers/:idPermanently delete a subscriber.
  • GET/api/v1/subscribers/:id/activityRecent activity timeline for one subscriber.
    Query parameters
    limitintegerNumber of entries, 1–100. Defaults to 30.
  • POST/api/v1/subscribers/importStart a CSV import from a multipart `file` field.
    • Maximum file size is 5 MB and the maximum is 20,000 valid rows.
    • The first row must contain headers; email is required, name is optional.
    • Imports run in the background and can be polled with the status endpoint.
    Example
    curl https://stalkmail.com/api/v1/subscribers/import \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -F "file=@contacts.csv"
    Response
    {
      "data": {
        "importId": "imp_…",
        "chunkCount": 1,
        "totalRows": 420,
        "validRows": 418,
        "invalidRows": 2,
        "status": "queued"
      }
    }

    Rate limit: 10 requests per minute per key.

  • GET/api/v1/subscribers/imports/:idStatus and counters for an import job.

Tags

Colour-coded labels used to filter contacts and build audiences.

  • GET/api/v1/tagsList tags with page pagination.
    Query parameters
    searchstringCase-insensitive text match.
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
  • POST/api/v1/tagsCreate a tag.
    JSON body
    name*string1–40 characters.
    colorstringSix-digit hex colour. Defaults to #8D967F.

    Rate limit: 60 requests per minute per key.

  • GET/api/v1/tags/:idRetrieve one tag.
  • PATCH/api/v1/tags/:idRename or recolour a tag.
    JSON body
    namestringNew name.
    colorstringNew hex colour.
  • DELETE/api/v1/tags/:idDelete a tag and remove it from every contact.

Custom fields

Extra contact properties stored at subscribers.fields.<key> and usable as {{key}} personalization tokens.

  • GET/api/v1/fieldsList custom fields with page pagination.
    Query parameters
    searchstringCase-insensitive text match.
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
  • POST/api/v1/fieldsCreate a custom field.
    • Keys are immutable identifiers once created; renaming the label does not break tokens.
    • Reserved keys such as email, name, status and unsubscribe_url cannot be used.
    JSON body
    label*stringShown in the dashboard, 1–60 chars.
    key*stringLowercase token starting with a letter. Reserved tokens are rejected.
    typeenumtext, number, date or url. Defaults to text.
  • GET/api/v1/fields/:idRetrieve one custom field.
  • PATCH/api/v1/fields/:idChange a field's label, key or type.
    JSON body
    labelstringNew label.
    keystringNew key.
    typeenumNew type.
  • DELETE/api/v1/fields/:idDelete a field and every stored value for it.

Segments

Saved audience rules evaluated against the newsletter's contacts. Conditions support engagement windows, tags, status and custom fields.

  • GET/api/v1/segmentsList saved segments with page pagination.
    Query parameters
    searchstringCase-insensitive text match.
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
  • POST/api/v1/segmentsCreate a saved segment.
    JSON body
    name*string1–60 characters.
    matchenumall or any. Defaults to all.
    conditions*array1–12 conditions.
    conditions[].typeenumopened, clicked, subscribed, tag, status or field.
    conditions[].operatorenumis, is_not, contains, is_empty or is_not_empty.
    conditions[].daysintegerLookback window for engagement conditions, 1–365.
    conditions[].valuestringTag id, status value or field text.
    conditions[].fieldKeystringCustom field key for field conditions.
    Example
    curl https://stalkmail.com/api/v1/segments \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Engaged 30 days",
        "match": "all",
        "conditions": [
          { "type": "opened", "days": 30, "operator": "is" },
          { "type": "status", "value": "subscribed", "operator": "is" }
        ]
      }'
  • GET/api/v1/segments/:idRetrieve one saved segment.
  • PATCH/api/v1/segments/:idUpdate a segment's name, match mode or conditions.
  • DELETE/api/v1/segments/:idDelete a segment. Contacts are unaffected.

Authors

People shown on the public website author profile and, optionally, in the email footer.

  • GET/api/v1/authorsList authors.
    Query parameters
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
  • POST/api/v1/authorsAdd an author.
    • A newsletter can have at most 10 authors.
    JSON body
    name*string1–80 characters.
    emailstringOptional contact email.
    photostringHTTPS photo URL.
    biostringUp to 500 characters.
    showOnWebbooleanShow on the public website. Defaults to true.
    showOnEmailbooleanShow in email footers. Defaults to false.

    Rate limit: 60 requests per minute per key.

  • GET/api/v1/authors/:idRetrieve one author.
  • PATCH/api/v1/authors/:idUpdate an author's profile or visibility.
  • DELETE/api/v1/authors/:idRemove an author.

Sender

From name and address, mailing address and the authors list used by campaign, confirmation and welcome emails.

  • GET/api/v1/senderSender identity, authors and verified from-domains.
    Response
    {
      "data": {
        "sender": {
          "fromName": "The Weekly",
          "fromEmail": "hello@the-weekly.com",
          "postalAddress": "12 Example St, Lisbon",
          "authors": []
        },
        "verifiedDomains": ["the-weekly.com"]
      }
    }
  • PATCH/api/v1/senderUpdate the sender identity or authors.
    • A from-email domain must be the newsletter's {slug}.stalkmail.com address, stalkmail.com, or a domain verified under Domains.
    JSON body
    fromNamestringUp to 100 characters.
    fromEmailstringFull from address.
    postalAddressstringUp to 200 characters.
    authorsarrayFull authors array, up to 10 entries.

    Rate limit: 30 requests per minute per key.

Domains

Sending domains registered with Amazon SES. Adding a domain returns the DNS verification records.

  • GET/api/v1/domainsList claimed domains with page pagination.
    Query parameters
    statusstringFilter by provider status.
    searchstringCase-insensitive text match.
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
  • POST/api/v1/domainsRegister a sending domain with SES and return its DNS records.
    JSON body
    domain*stringDomain name such as example.com.
    Response
    {
      "data": {
        "domain": "example.com",
        "status": "pending",
        "provider": "ses",
        "providers": {
          "ses": {
            "status": "pending",
            "dnsRecords": [
              { "name": "s1._domainkey.example.com", "type": "CNAME", "value": "s1.dkim.amazonses.com", "purpose": "DKIM", "provider": "ses" }
            ]
          }
        }
      }
    }

    Rate limit: 10 requests per hour per key.

  • GET/api/v1/domains/:domainRetrieve one claimed domain.
  • DELETE/api/v1/domains/:domainRemove a domain from this newsletter and from the provider.
  • POST/api/v1/domains/:domain/verifyAsk the provider to verify DNS records.

    Rate limit: 20 requests per hour per key.

  • POST/api/v1/domains/:domain/refreshRefresh the stored DNS records and status.

    Rate limit: 30 requests per hour per key.

API keys

Create and revoke keys for the newsletter. The plaintext key is returned once and only its SHA-256 hash is stored.

  • GET/api/v1/api-keysList keys with page pagination.
    Query parameters
    includeRevokedbooleanInclude revoked keys. Defaults to false.
    pageinteger1-based page number. Defaults to 1.
    perPageintegerResults per page, 1–100. Defaults to 50.
    Response
    {
      "data": [
        {
          "id": "key_…",
          "name": "CI deploy",
          "prefix": "sm_live_ab12",
          "createdAt": "2026-01-04T10:00:00.000Z",
          "lastUsedAt": null,
          "revoked": false
        }
      ],
      "pagination": { "page": 1, "perPage": 50, "total": 1, "pageCount": 1 }
    }
  • POST/api/v1/api-keysCreate a key. The plaintext `key` is returned once.
    JSON body
    name*string1–50 characters.
    Response
    {
      "data": {
        "id": "key_…",
        "name": "CI deploy",
        "prefix": "sm_live_ab12",
        "key": "sm_live_…",
        "revoked": false
      }
    }

    Rate limit: 10 requests per hour per key.

  • GET/api/v1/api-keys/:idRetrieve one key's metadata.
  • DELETE/api/v1/api-keys/:idRevoke a key. Requests using it fail immediately afterwards.
    • A key can revoke itself; the request succeeds and future calls fail.

Media

Upload images for campaign content, cover images or newsletter settings. The account credentials never leave the server.

  • POST/api/v1/mediaUpload an image from a multipart `file` field.
    • Accepts JPG, PNG and WebP up to 4 MB.
    • Returns the hosted HTTPS URL, file id, name and size.
    Example
    curl https://stalkmail.com/api/v1/media \
      -X POST \
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \
      -F "file=@cover.png"
    Response
    {
      "data": {
        "url": "https://nyc.cloud.appwrite.io/v1/storage/buckets/newsletter-media/files/f_…/view?project=…",
        "fileId": "…",
        "name": "campaign-….png",
        "size": 84213
      }
    }

    Rate limit: 30 requests per minute per key.

Settings

Every dashboard settings section. Fetch the full settings first, then PATCH only the fields you want to change. Kebab-case and camelCase section names both work.

  • GET/api/v1/settingsReturn every settings section.
    Response
    {
      "data": {
        "schemaVersion": 5,
        "confirmSignups": { "enabled": true, "subject": "Please confirm your subscription" },
        "welcomeEmail": { "enabled": true, "subject": "Welcome to {{newsletter_name}}" },
        "website": { "published": true, "description": "…", "socials": {} },
        "form": { "enabled": true, "heading": "Join the newsletter", "layout": "stacked" },
        "design": { "preset": "lime", "accent": "#B9F13F", "radius": 10 },
        "notifications": { "summary": "weekly", "mcpEnabled": true },
        "sender": { "fromName": "The Weekly", "fromEmail": "hello@the-weekly.com" },
        "listCleanup": { "enabled": true, "ignoredIssues": 6, "quietDays": 180 }
      },
      "sections": [
        "confirmSignups", "welcomeEmail", "website", "form",
        "design", "notifications", "sender", "listCleanup"
      ]
    }
  • GET/api/v1/settings/:sectionReturn one settings section.
    • Sections: confirmSignups, welcomeEmail, website, form, design, notifications, sender, listCleanup.
    • Kebab-case aliases such as confirm-signups, welcome-email and list-cleanup are accepted.
  • PATCH/api/v1/settings/:sectionUpdate fields in one settings section.
    • The body is merged with the current section, so partial updates keep existing values.
    • Sender changes still enforce the verified from-domain rule; PATCH /api/v1/sender is equivalent and preferred.
    • website.published must be on before a campaign can publish a web issue.
    • Design tokens are shared by the website, issue pages, join page, signup form and embed.
    JSON body
    confirmSignups.enabledbooleanUse double opt-in for form signups.
    confirmSignups.subjectstringConfirmation email subject, up to 120 chars.
    confirmSignups.previewTextstringPreview text, up to 140 chars.
    confirmSignups.bodystringPlain-text body with {{confirm_url}}, up to 5,000 chars.
    welcomeEmail.enabledbooleanSend a welcome email after confirmation.
    welcomeEmail.subjectstringWelcome subject.
    welcomeEmail.bodystringPlain-text body with {{unsubscribe_url}}.
    website.publishedbooleanPublish the public website and archive.
    website.descriptionstringHero description, up to 300 chars.
    website.socialsobject{ website, x, linkedin, instagram, youtube } URLs.
    form.enabledbooleanAccept signups from the hosted page and embed.
    form.domainsstring[]Allowed embed domains, up to 10.
    form.headingstringForm heading, up to 80 chars.
    form.layoutenumstacked or inline.
    form.collectNamebooleanAsk for a name in addition to email.
    form.redirectUrlstringHTTPS URL to redirect to after signup.
    design.presetenumlime, charcoal, sage or paper.
    design.accentstringSix-digit hex accent colour.
    design.radiusintegerCorner radius, 0–24.
    notifications.summaryenumoff, daily or weekly.
    notifications.mcpEnabledbooleanAllow agent actions through the /mcp endpoint.
    listCleanup.enabledbooleanEnable cold-contact handling.
    listCleanup.ignoredIssuesintegerIgnored issues before a contact becomes dormant, 2–100.
    listCleanup.quietDaysintegerQuiet days before cleanup, 30–3,650.
    listCleanup.lastChanceobject{ builtIn, subject, previewText, body, buttonLabel }.
    sender.fromNamestringFrom name, up to 100 chars.
    sender.fromEmailstringMust use the newsletter's {slug}.stalkmail.com, stalkmail.com, or a verified domain.
    sender.postalAddressstringMailing address shown in email footers.
    Example
    curl https://stalkmail.com/api/v1/settings/design \\
      -X PATCH \\
      -H "Authorization: Bearer $STALKMAIL_API_KEY" \\
      -H "Content-Type: application/json" \\
      -d '{ "accent": "#B9F13F", "radius": 14 }'

    Rate limit: 30 requests per minute per key.

Logs

The dashboard activity log. Every API write is recorded with actorType: "api" and the key id.

  • GET/api/v1/logsList logs with cursor pagination and filters.
    Query parameters
    levelenuminfo, warn or error.
    actorTypeenumuser, api, public or system.
    actionstringExact action name, such as campaign.sent.
    statusenumsuccess or failure.
    fromISO 8601 dateOnly include records created on or after this date.
    toISO 8601 dateOnly include records created on or before this date.
    limitintegerResults per page, 1–100. Defaults to 50.
    cursorstringOpaque cursor from pagination.nextCursor. Omit for the first page.
    Response
    {
      "data": [
        {
          "id": "…",
          "level": "info",
          "actorType": "api",
          "action": "campaign.sent",
          "status": "success",
          "message": "Queued campaign for immediate delivery.",
          "createdAt": "2026-11-01T09:00:00.000Z"
        }
      ],
      "pagination": { "nextCursor": null }
    }

    Rate limit: 120 requests per minute per key.

Notifications

Dashboard notifications. Keys and other resources created through the API notify the newsletter owner here.

  • GET/api/v1/notificationsList notifications with cursor pagination.
    Query parameters
    kindenumaction or news.
    unreadbooleanOnly unread notifications when true.
    limitintegerResults per page, 1–100. Defaults to 50.
    cursorstringOpaque cursor from pagination.nextCursor. Omit for the first page.
    Response
    {
      "data": [
        {
          "id": "ntf_…",
          "kind": "news",
          "type": "api_key.created",
          "title": "API key created",
          "body": "A new API key named "CI deploy" was created.",
          "href": "/dashboard/api-keys",
          "read": false,
          "createdAt": "2026-11-01T09:00:00.000Z"
        }
      ],
      "unreadCount": 1,
      "pagination": { "nextCursor": null }
    }
  • PATCH/api/v1/notificationsMark every notification read, or only the ids in the body.
    • Omit the body to mark everything read.
    • Send { "ids": ["ntf_…"] } to mark specific notifications.
    JSON body
    idsstring[]Notification ids, up to 100.
  • DELETE/api/v1/notificationsDelete every notification, or only the ids in the body.
    JSON body
    idsstring[]Notification ids, up to 100.
  • GET/api/v1/notifications/:idRetrieve one notification.
  • PATCH/api/v1/notifications/:idMark one notification read.
  • DELETE/api/v1/notifications/:idDelete one notification.

Public forms

Public signup endpoints scoped by newsletter slug, not by API key. They honour the form toggle, domain allowlist and double opt-in.

  • GET/api/forms/:slugForm settings and design tokens for the hosted page and embed.
  • POST/api/forms/:slug/subscribeSubmit a signup. Returns `pending` when double opt-in is on.
    • Requires an allowed Origin header when an allowlist is configured.
    • A honeypot field and per-IP rate limiting protect the endpoint.

Settings coverage

General details live under /api/v1/newsletter, sender identity under /api/v1/sender, and every other dashboard section under /api/v1/settings/:section: confirmSignups, welcomeEmail, website, form, design, notifications and listCleanup. Settings PATCH requests merge into the current values, so you can send only what changed. The only dashboard action not exposed is creating or switching a newsletter, which is an account-level session action rather than a per-newsletter API operation.

MCP clients

MCP tools call StalkMail through the dedicated /mcp endpoint with the same API key. The newsletter owner can turn agent actions off in Settings → Notifications without revoking the key. The MCP endpoint returns 403 forbidden while the toggle is off. Plain REST API requests are unaffected.

Sending safely from an agent

  1. Create the campaign with POST /api/v1/campaigns, then write the content with PATCH /api/v1/campaigns/:id.
  2. Render GET /api/v1/campaigns/:id/preview and send a test to yourself with POST /api/v1/campaigns/:id/test.
  3. Send with a specific audience.type of segments or contacts. The API rejects everyone unless the request also sets "confirm": true.
  4. Poll GET /api/v1/campaigns/:id and read status and stats as delivery progresses.