RSS Feeds

Connect RSS feeds to automatically send emails to your audience when new content is published. Veil Mail polls your feeds on a configurable schedule and sends digest or individual emails for each new item.

Create a Feed

Register an RSS or Atom feed URL and link it to an audience. New feeds start in active status and begin polling immediately.

POST /v1/feeds
create-feed.ts
const feed = await client.feeds.create({
  name: 'Company Blog',
  url: 'https://blog.example.com/feed.xml',
  audienceId: 'audience_xxxxx',
  pollInterval: 'daily',
  mode: 'single',
});

console.log(feed.id);     // feed_xxxxx
console.log(feed.status); // active

Parameters

FieldTypeDescription
namestringDisplay name for the feed
urlstringRSS or Atom feed URL
audienceIdstringTarget audience for emails
pollIntervalstringhourly, daily, or weekly
modestringsingle (one email per item) or digest (all new items in one email)

List Feeds

GET /v1/feeds
list-feeds.ts
const { data } = await client.feeds.list();

for (const feed of data) {
  console.log(`${feed.name} (${feed.status}) — polls ${feed.pollInterval}`);
}

Get a Feed

Retrieve a single feed by ID. The response includes the most recent items discovered by the poller.

GET /v1/feeds/:id
get-feed.ts
const feed = await client.feeds.get('feed_xxxxx');

console.log(feed.name);
console.log(feed.lastPolledAt);
console.log(`${feed.recentItems.length} recent items`);

Update and Delete

Update a Feed

PUT /v1/feeds/:id
update-feed.ts
const feed = await client.feeds.update('feed_xxxxx', {
  pollInterval: 'hourly',
  mode: 'digest',
});

Delete a Feed

Deleting a feed removes it and all its stored items permanently.

DELETE /v1/feeds/:id
delete-feed.ts
const { deleted } = await client.feeds.delete('feed_xxxxx');
console.log(deleted); // true

Feed Actions

Control feed polling and lifecycle with these actions.

Manual Poll

Trigger an immediate poll regardless of the configured schedule.

POST /v1/feeds/:id/poll
poll-feed.ts
const result = await client.feeds.poll('feed_xxxxx');
console.log(`Found ${result.newItems} new items`);

Pause and Resume

POST /v1/feeds/:id/pause
POST /v1/feeds/:id/resume
pause-resume-feed.ts
// Pause polling
const paused = await client.feeds.pause('feed_xxxxx');
console.log(paused.status); // paused

// Resume polling (also works for feeds in error state)
const resumed = await client.feeds.resume('feed_xxxxx');
console.log(resumed.status); // active

Feed Items

Each time the poller discovers new content, it creates feed items. You can list items with pagination and filter by processing status.

GET /v1/feeds/:id/items
list-feed-items.ts
// List all items
const { data, hasMore } = await client.feeds.listItems('feed_xxxxx', {
  limit: 20,
});

// List only unprocessed items
const pending = await client.feeds.listItems('feed_xxxxx', {
  processed: false,
});

for (const item of data) {
  console.log(`${item.title} — published ${item.publishedAt}`);
}

Feed Status

StatusDescription
activePolling on schedule and sending emails
pausedPolling suspended; can be resumed
errorFeed URL unreachable or invalid; use resume to retry

Requires the feed:read scope for read operations and feed:write scope for mutations.