Change newsletter settings
const url = 'https://digize.com/api/v1/newsletter/settings';const options = { method: 'PATCH', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"provider":"resend","fromAddressId":"example","doubleOptIn":true,"address":"example","postUrl":"example","tracking":{"opens":true,"clicks":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://digize.com/api/v1/newsletter/settings \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "provider": "resend", "fromAddressId": "example", "doubleOptIn": true, "address": "example", "postUrl": "example", "tracking": { "opens": true, "clicks": true } }'Saves some of the Newsletter module’s settings; what’s left out stays as it is. Open tracking covers conversation and automation emails too.
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
Whether people who sign up on a form, at checkout or through the API confirm by email first.
The business’s postal address, in every post’s footer as anti-spam laws ask. A post can’t be sent without it.
Where a post is on the workspace’s own site, with {slug} for its slug, such as https://example.com/blog/{slug}; empty for none. The view online and web links use it.
Whether the workspace’s email says when it’s opened and clicked.
object
The open pixel in posts, conversation emails and automations’ emails.
Posts’ links go through Digize first.
Responses
Section titled “Responses”Done
object
Whether people who sign up on a form, at checkout or through the API confirm by email first.
The business’s postal address, in every post’s footer as anti-spam laws ask. A post can’t be sent without it.
Where a post is on the workspace’s own site, with {slug} for its slug, such as https://example.com/blog/{slug}; empty for none. The view online and web links use it.
Whether the workspace’s email says when it’s opened and clicked.
object
The open pixel in posts, conversation emails and automations’ emails.
Posts’ links go through Digize first.
Example
{ "provider": "resend"}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" }}