Add an RSS feed
const url = 'https://digize.com/api/v1/newsletter/feeds';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"mode":"draft","digest":{"frequency":"daily","day":"sunday","hour":1},"audience":{"tags":[],"excludeTags":[],"stages":[],"lists":["example"],"excludeLists":["example"],"tier":"example"},"subject":"example","intro":"example","active":true,"url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://digize.com/api/v1/newsletter/feeds \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "mode": "draft", "digest": { "frequency": "daily", "day": "sunday", "hour": 1 }, "audience": { "tags": [], "excludeTags": [], "stages": [], "lists": [ "example" ], "excludeLists": [ "example" ], "tier": "example" }, "subject": "example", "intro": "example", "active": true, "url": "example" }'Adds an RSS 2.0 or Atom feed, read once now to check it: the items it has now are never posted; ones it gets later become a draft post each, or go in a digest sent daily or weekly at an hour on the workspace’s clock to audience. Feeds are checked hourly.
Needs the newsletter:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
Who a digest goes to.
object
Any of these tags; empty for everyone subscribed.
Leaves out contacts with any of these tags.
Leads (no orders), customers (1–2) or repeat customers (3 or more); empty for all.
In any of these CRM lists (crm.lists.list), smart or static; empty for no list.
Leaves out anyone in any of these segments (CRM lists, newsletter.segments.list); empty to leave nobody out.
Readers by tier: all (or left out), free readers only, paid readers of any tier, or one tier’s id (newsletter.tiers.list). A paid-only post goes to paid readers whatever this says.
A digest’s subject; {{date}} is filled in.
Words before a digest’s items.
Responses
Section titled “Responses”Done
object
The feed’s own title, from its last check.
draft: a draft post for each new item; digest: the new items in a post sent on a schedule.
The digest’s schedule in words.
object
Any of these tags; empty for everyone subscribed.
Leaves out contacts with any of these tags.
Leads (no orders), customers (1–2) or repeat customers (3 or more); empty for all.
In any of these CRM lists (crm.lists.list), smart or static; empty for no list.
Leaves out anyone in any of these segments (CRM lists, newsletter.segments.list); empty to leave nobody out.
Readers by tier: all (or left out), free readers only, paid readers of any tier, or one tier’s id (newsletter.tiers.list). A paid-only post goes to paid readers whatever this says.
Why the last check or digest didn’t work.
object
object
Example
{ "mode": "draft", "digest": { "frequency": "daily", "day": "sunday", "hour": 9 }, "audience": { "tags": [], "excludeTags": [], "stages": [] }, "latest": [ { "state": "baseline" } ]}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}