Change a signup form
const url = 'https://digize.com/api/v1/newsletter/forms/example';const options = { method: 'PATCH', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"name":"example","mode":"inline","status":"active","content":{"heading":"Get our newsletter","body":"New posts in your inbox. No spam, and you can leave any time.","button":"Subscribe","success":"You\'re subscribed. Thanks for joining!","confirm":"Almost there: check your inbox and confirm your subscription.","redirectUrl":null,"footnote":"","emailPlaceholder":"you@example.com"},"fields":{"name":"off","custom":[]},"look":{"background":"#ffffff","text":"#18181b","button":"#7c3aed","buttonText":"#ffffff","radius":12,"position":"left","imageUrl":null},"trigger":{"delay":5,"scroll":null,"exitIntent":false,"frequencyDays":7,"hideForSubscribers":true},"doubleOptIn":"default","tags":["example"],"siteIds":["example"]}'};
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/forms/example \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "name": "example", "mode": "inline", "status": "active", "content": { "heading": "Get our newsletter", "body": "New posts in your inbox. No spam, and you can leave any time.", "button": "Subscribe", "success": "You'\''re subscribed. Thanks for joining!", "confirm": "Almost there: check your inbox and confirm your subscription.", "redirectUrl": null, "footnote": "", "emailPlaceholder": "you@example.com" }, "fields": { "name": "off", "custom": [] }, "look": { "background": "#ffffff", "text": "#18181b", "button": "#7c3aed", "buttonText": "#ffffff", "radius": 12, "position": "left", "imageUrl": null }, "trigger": { "delay": 5, "scroll": null, "exitIntent": false, "frequencyDays": 7, "hideForSubscribers": true }, "doubleOptIn": "default", "tags": [ "example" ], "siteIds": [ "example" ] }'Changes a signup form; what’s left out stays. Pages showing it pick the change up within a minute. status: paused hides it everywhere.
Needs the newsletter:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path 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
object
object
default follows Newsletter › Settings; on or off for this form whatever they say.
Tags its subscribers get.
Responses
Section titled “Responses”Done
object
object
object
Digize sites whose pages show it without the snippet.
Subscriptions it started.
Of those, the ones subscribed now.
Example
{ "mode": "inline", "status": "active", "content": { "heading": "Get our newsletter", "body": "New posts in your inbox. No spam, and you can leave any time.", "button": "Subscribe", "success": "You're subscribed. Thanks for joining!", "confirm": "Almost there: check your inbox and confirm your subscription.", "redirectUrl": null, "footnote": "", "emailPlaceholder": "you@example.com" }, "fields": { "name": "off", "custom": [] }, "look": { "background": "#ffffff", "text": "#18181b", "button": "#7c3aed", "buttonText": "#ffffff", "radius": 12, "position": "left", "imageUrl": null }, "trigger": { "delay": 5, "scroll": null, "exitIntent": false, "frequencyDays": 7, "hideForSubscribers": true }, "doubleOptIn": "default"}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" }}