Skip to content

Make a signup form

POST
/api/v1/newsletter/forms
curl --request POST \
--url https://digize.com/api/v1/newsletter/forms \
--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" ] }'

Makes a newsletter signup form. What’s left out takes the defaults. The workspace’s publishable key is made too if it has none, so the form’s embed snippet works at once.

Needs the newsletter:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

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-1f2d3c4b5a69
Media typeapplication/json
object
name
required
string
>= 1 characters <= 80 characters
mode
required
string
Allowed values: inline popup slide_in full_page
status
string
Allowed values: active paused
content
object
heading
string
default: Get our newsletter <= 120 characters
body
string
default: New posts in your inbox. No spam, and you can leave any time. <= 500 characters
button
string
default: Subscribe >= 1 characters <= 40 characters
success
string
default: You're subscribed. Thanks for joining! >= 1 characters <= 300 characters
confirm
string
default: Almost there: check your inbox and confirm your subscription. >= 1 characters <= 300 characters
redirectUrl
Any of:
string
<= 2000 characters
footnote
string
"" <= 300 characters
emailPlaceholder
string
default: you@example.com <= 80 characters
fields
object
name
string
default: off
Allowed values: off optional required
custom
Array<object>
default: <= 10 items
object
key
required
string
>= 1 characters <= 60 characters
required
boolean
look
object
background
string
default: #ffffff /^#[0-9a-f]{6}$/
text
string
default: #18181b /^#[0-9a-f]{6}$/
button
string
default: #7c3aed /^#[0-9a-f]{6}$/
buttonText
string
default: #ffffff /^#[0-9a-f]{6}$/
radius
integer
default: 12 <= 32
position
string
default: right
Allowed values: left right
imageUrl
Any of:
string
<= 2000 characters
trigger
object
delay
Any of:
integer
<= 600
scroll
Any of:
integer
>= 1 <= 100
exitIntent
boolean
frequencyDays
integer
default: 7 <= 365
hideForSubscribers
boolean
default: true
doubleOptIn

default follows Newsletter › Settings; on or off for this form whatever they say.

string
Allowed values: default on off
tags

Tags its subscribers get.

Array<string>
<= 20 items
siteIds
Array<string>
<= 50 items

Done

Media typeapplication/json
object
id
required
string
name
required
string
mode
required
string
Allowed values: inline popup slide_in full_page
status
required
string
Allowed values: active paused
content
required
object
heading
required
string
default: Get our newsletter <= 120 characters
body
required
string
default: New posts in your inbox. No spam, and you can leave any time. <= 500 characters
button
required
string
default: Subscribe >= 1 characters <= 40 characters
success
required
string
default: You're subscribed. Thanks for joining! >= 1 characters <= 300 characters
confirm
required
string
default: Almost there: check your inbox and confirm your subscription. >= 1 characters <= 300 characters
redirectUrl
required
Any of:
string
<= 2000 characters
footnote
required
string
"" <= 300 characters
emailPlaceholder
required
string
default: you@example.com <= 80 characters
fields
required
object
name
required
string
default: off
Allowed values: off optional required
custom
required
Array<object>
default: <= 10 items
object
key
required
string
>= 1 characters <= 60 characters
required
required
boolean
look
required
object
background
required
string
default: #ffffff /^#[0-9a-f]{6}$/
text
required
string
default: #18181b /^#[0-9a-f]{6}$/
button
required
string
default: #7c3aed /^#[0-9a-f]{6}$/
buttonText
required
string
default: #ffffff /^#[0-9a-f]{6}$/
radius
required
integer
default: 12 <= 32
position
required
string
default: right
Allowed values: left right
imageUrl
required
Any of:
string
<= 2000 characters
trigger
required
object
delay
required
Any of:
integer
<= 600
scroll
required
Any of:
integer
>= 1 <= 100
exitIntent
required
boolean
frequencyDays
required
integer
default: 7 <= 365
hideForSubscribers
required
boolean
default: true
doubleOptIn
required
string
Allowed values: default on off
tags
required
Array<string>
siteIds
required

Digize sites whose pages show it without the snippet.

Array<string>
createdBy
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
signups
required

Subscriptions it started.

number
subscribed
required

Of those, the ones subscribed now.

number

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).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}