Save the prompt's draft
PUT
/api/v1/workspaces/{workspace}/push/prompts/{formId}
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://reputecast.example.com/api/v1/workspaces/acme-newsletter/push/prompts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
payload := strings.NewReader("{ \"config\": { \"allow\": \"example\", \"askAgainDays\": 1, \"corner\": \"bottom_right\", \"ios\": \"steps\", \"message\": \"example\", \"notNow\": \"example\", \"pages\": \"all_except\", \"paths\": [ \"example\" ], \"style\": \"bar\", \"title\": \"example\", \"when\": { \"button\": true, \"posts\": { \"n\": 1, \"on\": true }, \"scroll\": { \"n\": 1, \"on\": true }, \"seconds\": { \"n\": 1, \"on\": true } } }, \"siteId\": \"example\" }")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://reputecast.example.com/api/v1/workspaces/acme-newsletter/push/prompts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"config":{"allow":"example","askAgainDays":1,"corner":"bottom_right","ios":"steps","message":"example","notNow":"example","pages":"all_except","paths":["example"],"style":"bar","title":"example","when":{"button":true,"posts":{"n":1,"on":true},"scroll":{"n":1,"on":true},"seconds":{"n":1,"on":true}}},"siteId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://reputecast.example.com/api/v1/workspaces/acme-newsletter/push/prompts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "config": { "allow": "example", "askAgainDays": 1, "corner": "bottom_right", "ios": "steps", "message": "example", "notNow": "example", "pages": "all_except", "paths": [ "example" ], "style": "bar", "title": "example", "when": { "button": true, "posts": { "n": 1, "on": true }, "scroll": { "n": 1, "on": true }, "seconds": { "n": 1, "on": true } } }, "siteId": "example" }'Permission: forms:edit
Readers see it once it’s published.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspace
required
Workspace slug
string
Workspace slug
formId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
config
required
object
allow
required
string
askAgainDays
required
integer format: int64
corner
string
ios
required
string
message
required
string
notNow
required
string
pages
required
string
paths
required
Array<string>
style
required
string
title
required
string
when
required
object
button
required
boolean
posts
required
object
n
required
integer format: int64
on
required
boolean
scroll
required
object
n
required
integer format: int64
on
required
boolean
seconds
required
object
n
required
integer format: int64
on
required
boolean
siteId
string
Responses
Section titled “Responses”OK
Media typeapplication/json
object
canEdit
required
boolean
changed
required
boolean
consent
object
at
required
string format: date-time
browser
required
string
contact
string
contactId
string
ip
string
linkedBy
string
page
required
string
publishedAt
string format: date-time
publishedBy
string
site
required
string
text
required
string
timeZone
required
string
version
required
integer format: int64
draft
required
object
allow
required
string
askAgainDays
required
integer format: int64
corner
string
ios
required
string
message
required
string
notNow
required
string
pages
required
string
paths
required
Array<string>
style
required
string
title
required
string
when
required
object
button
required
boolean
posts
required
object
n
required
integer format: int64
on
required
boolean
scroll
required
object
n
required
integer format: int64
on
required
boolean
seconds
required
object
n
required
integer format: int64
on
required
boolean
formId
required
string
iconUrl
string
live
object
allow
required
string
askAgainDays
required
integer format: int64
corner
string
ios
required
string
message
required
string
notNow
required
string
pages
required
string
paths
required
Array<string>
style
required
string
title
required
string
when
required
object
button
required
boolean
posts
required
object
n
required
integer format: int64
on
required
boolean
scroll
required
object
n
required
integer format: int64
on
required
boolean
seconds
required
object
n
required
integer format: int64
on
required
boolean
liveSince
string format: date-time
liveVersion
required
integer format: int64
name
required
string
pushOn
required
boolean
site
object
host
required
string
id
string
kind
required
string
origin
required
string
pushSite
required
boolean
website
required
boolean
sites
required
Array<object>
object
host
required
string
id
string
kind
required
string
origin
required
string
pushSite
required
boolean
website
required
boolean
stats
required
object
allowed
required
integer format: int64
allowedPct
required
number format: double
bellClicked
required
integer format: int64
blocked
required
integer format: int64
closed
required
integer format: int64
closedPct
required
number format: double
granted
required
integer format: int64
grantedPct
required
number format: double
iosAdded
required
integer format: int64
iosAddedPct
required
number format: double
iosSteps
required
integer format: int64
iosSubscribers
required
integer format: int64
notNow
required
integer format: int64
notNowPct
required
number format: double
shown
required
integer format: int64
since
required
string format: date-time
sinceSnippet
required
boolean
status
required
string
updatedAt
required
string format: date-time
updatedBy
required
string
Example
{ "draft": { "corner": "bottom_right", "ios": "steps", "pages": "all_except", "style": "bar" }, "live": { "corner": "bottom_right", "ios": "steps", "pages": "all_except", "style": "bar" }, "site": { "kind": "publication" }, "sites": [ { "kind": "publication" } ], "status": "draft"}default
Section titled “default”Error
Media typeapplication/problem+json
object
code
Stable error code, e.g. permission_denied
string
detail
A human-readable explanation specific to this occurrence of the problem.
string
errors
Optional list of individual error details
Array<object>
object
location
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
string
message
Error message text
string
value
The value at the given location
helpers
Members who hold the missing permission
Array<string>
instance
A URI reference that identifies the specific occurrence of the problem.
string format: uri
meta
object
key
additional properties
permission
The missing permission key
string
status
HTTP status code
integer format: int64
title
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
string
type
A URI reference to human-readable documentation for the error.
string format: uri
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}