Skip to content
Menu

Reference

Send API

Markdown version

Send push, web push, email, SMS, in-app messages and content cards from your backend to named people or a segment, now or on a schedule, with scoped API keys, hourly limits and idempotency.

Before you start

  • An app whose connection sends through Herald. The Send API refuses other connections with a 400.
  • An API key for that app with the scopes you need. See Authentication.
  • For email: a verified sending domain on the connection.

The Send API sends every channel Herald delivers to people you name or to a segment, immediately or on a schedule, with the message content in the request. Each send shows in the console's campaign list. It uses the same scheduling, local time, quiet hours, suppression and unsubscribe checks as a campaign.

Authentication

Send Authorization: Bearer hk_… with every request. Create keys under Settings → Sending, the app, then API keys. Herald shows a key once.

A key belongs to one app. Its scopes, optional IP allowlist and optional expiry are fixed when you create it; to change them, create a new key and revoke the old one.

ScopeAllows
messages.sendPOST /api/v1/messages/send
messages.scheduleA send with schedule (together with messages.send), and changing or cancelling a scheduled send
messages.readReading one send and listing sends
exports.readThe decisions CSV
journeys.enterAdding people to a journey
mcp.read, mcp.writeThe MCP server

A missing, unknown, revoked or expired key gets 401 Invalid API key. A key without a scope gets 403 This API key lacks the <scope> scope. The ingest token and the app key can never send, and an API key can't call the ingest or console endpoints.

Base URL

https://app.runherald.com. Requests and responses are JSON: { "data": ... } on success and { "error": "..." } on failure.

Rate limits

Each app has hourly pools, counted per UTC clock hour. A request charges every pool it touches at once: if any would go over, nothing is charged and the response is 429 naming the pool.

PoolCountsDefault per hour
api.requestsAny request made with an API key36,000
messages.pushRecipients250,000
messages.web_pushRecipients250,000
messages.emailRecipients100,000
messages.smsRecipients2,000
messages.in_appRecipients250,000
messages.content_cardRecipients250,000
messages.broadcastBroadcast requests25
messages.scheduleChange or cancel requests1,000
messages.readStatus or list requests3,600

A send charges each channel's pool once per recipient. A broadcast charges messages.broadcast once, since its audience size isn't known until it goes out. A dry_run charges only api.requests. Every response carries the rate-limit headers; see API errors.

Send API pushes count toward the app's push limit but are never skipped by it.

Idempotency

Send Idempotency-Key (1 to 255 characters) on POST /api/v1/messages/send so a retry can't send twice. Keys are per app and kept for 24 hours.

  • The same key and the same body (key order doesn't matter) return the first response again, with nothing sent.
  • The same key with a different body gets 409 This Idempotency-Key was used with a different request.
  • While the first request is still running, the key gets 409 A request with this Idempotency-Key is still in progress. A claim unfinished after 2 minutes is treated as abandoned.
  • A failed request releases its key, so you can retry with it.
  • A dry_run never uses the key.

POST /api/v1/messages/send

Scope messages.send, plus messages.schedule when the body has schedule.

Request

FieldRules
nameOptional, 1 to 80 characters. Default API send <time>
recipients1 to 50 people, each { "external_user_id": "...", "properties": { ... } }. IDs are 1 to 255 characters and unique. properties holds strings, numbers or booleans for personalization
broadcast, segmentInstead of recipients: "broadcast": true and a segment name. Never both
messagesAt least one channel: push, web_push, email, sms, in_app, content_card. See Channel content
scheduleOptional; absent means now. { "time": "2026-12-01T09:00:00Z" } is that instant. { "time": "2026-12-01T09:00:00", "in_local_time": true } (no offset) is each person's local wall time, or the app's time zone when theirs is unknown. In the future and at most 30 days ahead
quiet_hoursOptional skip, wait or off. Default off for recipients (transactional) and skip for broadcasts
categoryOptional category key, such as transactional, lifecycle, engagement or promotions. An unknown key is a 400. With a category the message follows that category's budget rules (transactional is exempt; in Enforce mode, others can be held or deferred like a campaign). Without one it is never held and counts toward the channel limit only. Pass one. See Message priority
dry_runOptional true: validate and count without storing or sending

Personalization. Any string field can hold {{key}} or {{key|fallback}}, filled from each recipient's properties. Every placeholder without a fallback must exist for every recipient, or the request fails with 400. Values are HTML-escaped in email HTML. Broadcasts have no properties, so only placeholders with a fallback work there.

People this app can't reach (an unknown external_user_id, or one with no reachable contact or device) are skipped, never created, and listed in unknown_recipients. If none of the recipients exist, the request fails with 400.

shell
curl -X POST "https://app.runherald.com/api/v1/messages/send" \
  -H "Authorization: Bearer $HERALD_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-A-991-shipped" \
  -d '{
    "name": "Order shipped",
    "recipients": [
      { "external_user_id": "u_123", "properties": { "first_name": "Ana", "order": "A-991" } }
    ],
    "messages": {
      "push": { "title": "Hi {{first_name}}", "body": "Order {{order}} shipped", "deeplink": "myapp://orders" }
    }
  }'

Response

202 with the send:

FieldValue
send_idThe send's ID, for status, change and cancel
nameThe send's name
statusscheduled
scheduled_forWhen it goes out: an instant, or a wall time with no offset when in_local_time
in_local_timeWhether scheduled_for is each person's local time
created_atWhen the send was created
recipientsPeople it will reach (for a broadcast, the segment's current count)
unknown_recipientsExternal IDs that were skipped
channelsThe channels in the send
json
{ "data": { "send_id": "cmh…", "name": "Order shipped", "status": "scheduled",
  "scheduled_for": "2026-11-24T18:00:00.000Z", "in_local_time": false, "created_at": "2026-11-24T18:00:00.000Z",
  "recipients": 1, "unknown_recipients": [], "channels": ["push"] } }

A dry_run answers 200 with { "valid": true, "recipients", "unknown_recipients", "channels", "charges" }, where charges maps each pool to what a real send would charge.

Channel content

ChannelFields
pushtitle (1 to 65), body (1 to 240), optional imageUrl, deeplink, story (see Push stories)
web_pushtitle (1 to 65), body (1 to 240), optional url, iconUrl
emailfromName (1 to 60, no <, > or quotes), fromDomainId (a verified sending domain), subject (1 to 120), optional preheader (up to 140), and exactly one of html or templateId
smsbody (1 to 1,600)
in_applayout (modal or slideup), title (up to 60), body (up to 240), optional imageUrl, buttons (up to 2, each label up to 24 and optional deeplink), optional trigger ({ "kind": "next_open" } or { "kind": "event", "name": "..." })
content_cardtitle (up to 60), body (up to 240), pinned (true or false), optional imageUrl, link, expiresAt (UTC, ending in Z)

Lengths count characters. Links must be http(s) URLs or app links such as myapp://path.

Push stories

A push can be a story: 2 to 10 pages the person flips through. Add story to messages.push:

json
{
  "push": {
    "story": {
      "pages": [
        { "imageUrl": "https://cdn.example.com/plans.jpg", "title": "New plans", "subtitle": "Start one today", "deeplink": "myapp://plans" },
        { "imageUrl": "https://cdn.example.com/streak.jpg", "title": "Streaks", "subtitle": "Keep yours going" }
      ]
    }
  }
}
  • Each page has imageUrl (an https URL, required), title (1 to 65), subtitle (1 to 240) and an optional deeplink. A page without a deeplink opens the app.
  • title, body, imageUrl and deeplink on the push are optional with a story and are replaced by the first page's (its subtitle becomes the body), so a device without story support shows the first page as a normal push.
  • The pages (as compact JSON) plus the first page's title, subtitle, image URL and link must fit in 3,400 bytes, because the first page is sent twice; Apple and Google cap a push at 4 KB.
  • A story takes no media.
  • Errors start with messages.push: story: , for example messages.push: story: page 2 needs an https image URL.

See Push stories for what the apps need.

GET /api/v1/messages/{id}

Scope messages.read. Returns one send this app created through the API.

shell
curl "https://app.runherald.com/api/v1/messages/SEND_ID" \
  -H "Authorization: Bearer $HERALD_API_KEY"
FieldValue
send_id, name, scheduled_for, in_local_time, created_atAs in the send response
statusscheduled, expanding, sending, sent, partly_sent, cancelled or failed
channelsPer channel: targeted, error (why the channel failed, else null), and counts by status: queued, sending, sent, failed, suppressed, cancelled. In-app messages and content cards report delivered instead

Status lookups are meant for occasional checks; they count toward messages.read.

GET /api/v1/messages

Scope messages.read. Lists this app's API sends, newest first.

Query parameterRules
statusOptional; one of the statuses above
limitOptional, 1 to 100; default 50
cursorOptional; the next_cursor of the previous page
shell
curl "https://app.runherald.com/api/v1/messages?status=scheduled&limit=20" \
  -H "Authorization: Bearer $HERALD_API_KEY"

The response is { "data": { "sends": [...], "next_cursor": "..." } }. Each send has the fields of the send response plus channels. next_cursor is null on the last page.

PATCH /api/v1/messages/{id}

Scope messages.schedule. Changes a scheduled send. The body takes any of schedule, messages and name, with the same rules as the send. messages replaces the content of the channels it names; it can't add or remove channels. schedule: null is refused; leave it out to keep the current time.

A send can change only while its status is scheduled and more than 5 minutes before it goes out. Otherwise the answer is 409 This send has already started.

shell
curl -X PATCH "https://app.runherald.com/api/v1/messages/SEND_ID" \
  -H "Authorization: Bearer $HERALD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "schedule": { "time": "2026-12-02T09:00:00", "in_local_time": true } }'

The response is the send's summary with its channels.

DELETE /api/v1/messages/{id}

Scope messages.schedule. Cancels a scheduled send; messages not yet delivered are cancelled. A send that has started gets 409 This send has already started.

shell
curl -X DELETE "https://app.runherald.com/api/v1/messages/SEND_ID" \
  -H "Authorization: Bearer $HERALD_API_KEY"

It returns { "data": { "send_id": "...", "status": "cancelled" } }.

Errors

StatusBody errorCause
400Invalid JSON body or Body must be a JSON objectThe body is not a JSON object
400A rule and its field, such as recipients must have 1 to 50 entries, messages.push: ... or schedule must be in the futureThe request breaks a rule above
400Recipient "u_123" has no "first_name" property for messages.pushA placeholder without a fallback has no value
400category must be one of: <keys>category isn't a category key of this app
400None of the recipients existNo recipient is known to this app
400Pick a verified sending domainemail has no fromDomainId, or it isn't a verified domain of this connection
400The Send API needs a connection that sends through HeraldThe key's app sends through another tool
400Idempotency-Key must be 1 to 255 charactersBad header
401Invalid API keyMissing, unknown, revoked or expired key
403This API key lacks the <scope> scopeWrong scopes
403This API key's app is disabledThe app is turned off
403This IP address isn't allowed for this API keyThe key has an IP allowlist
404Send not foundNo such send created through this app's API keys
409This send has already startedChange or cancel too late
409This Idempotency-Key was used with a different request, or A request with this Idempotency-Key is still in progressSee Idempotency
429Rate limit exceeded for <pool>: <limit> per hourOver a pool's hourly limit; wait for Retry-After
500Internal server errorServer failure

See API errors for status meanings, retries and headers.

Held messages

A send with a category can be held by the person's attention budget. The message is recorded as suppressed with the error budget:budget_full, budget:category_cap, budget:reserved or budget:expired; see Message priority.

Not in this version

Status webhooks, per-person frequency caps for API sends without a category (quiet hours apply; agent caps don't), per-key rate limits (limits are per app), optimal-time sends and Live Activities.

See Herald decide live →