Make a page, a draft: its name, slug, an active custom domain of the workspace's, its target (none for hosted) and its content
POST
/v1/buyer/pages
const url = 'https://example.com/v1/buyer/pages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"campaign_key":"example","content":{"blocks":[{"align":"start","button":{"full_width":true,"label":"example","offer":1,"style":"filled"},"divider":{},"heading":{"level":1,"text":"example"},"image":{"alt":"example","asset_id":1,"offer":1,"width":1},"list":{"items":["example"],"style":"bullets"},"quote":{"author":"example","text":"example"},"spacer":{"height":1},"text":{"text":"example"}}],"description":"example","favicon_asset_id":1,"indexable":true,"language":"example","theme":{"accent_color":"example","accent_text_color":"example","background_color":"example","font":"sans","max_width":1,"text_color":"example"},"title":"example"},"direct":true,"domain":"example","expected_sequence":1,"name":"example","protected":true,"protection_window_seconds":1,"slug":"example","target_id":1}'};
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://example.com/v1/buyer/pages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "campaign_key": "example", "content": { "blocks": [ { "align": "start", "button": { "full_width": true, "label": "example", "offer": 1, "style": "filled" }, "divider": {}, "heading": { "level": 1, "text": "example" }, "image": { "alt": "example", "asset_id": 1, "offer": 1, "width": 1 }, "list": { "items": [ "example" ], "style": "bullets" }, "quote": { "author": "example", "text": "example" }, "spacer": { "height": 1 }, "text": { "text": "example" } } ], "description": "example", "favicon_asset_id": 1, "indexable": true, "language": "example", "theme": { "accent_color": "example", "accent_text_color": "example", "background_color": "example", "font": "sans", "max_width": 1, "text_color": "example" }, "title": "example" }, "direct": true, "domain": "example", "expected_sequence": 1, "name": "example", "protected": true, "protection_window_seconds": 1, "slug": "example", "target_id": 1 }'Who: a workspace’s buyer, or its key. API keys with the buyer:write scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
Made once per action and sent again on every retry of it, so the service acts once: the request_id of the create or money-moving call; a new one when left out
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
campaign_key
string | null
content
Any of:
object
blocks
required
Array<object>
object
align
string
button
image
description
string
favicon_asset_id
integer format: int64
indexable
boolean
language
string
theme
title
required
string
null
direct
boolean | null
domain
string | null
expected_sequence
integer | null format: int64
name
string | null
protected
boolean | null
protection_window_seconds
integer | null format: int64
slug
string | null
target_id
integer | null format: int64
Responses
Section titled “Responses”Created
Media typeapplication/json
object
campaign_key
required
string
changed
required
boolean
content
required
Any of:
object
blocks
required
Array<object>
object
align
required
string | null
button
required
image
required
description
required
string
favicon_asset_id
required
integer format: int64
indexable
required
boolean
language
required
string
theme
required
object
accent_color
required
string
accent_text_color
required
string
background_color
required
string
font
required
string | null
max_width
required
integer format: int32
text_color
required
string
title
required
string
null
created_at
required
string format: date-time
created_by
required
direct
required
boolean
domain
required
string
id
required
integer format: int64
latest_build_id
required
string | null
latest_build_number
required
integer format: int32
name
required
string
offers_count
required
integer format: int32
protected
required
boolean
protection_window_seconds
required
integer format: int64
release
required
Any of:
object
build_id
required
string
build_number
required
integer format: int32
deployment_id
required
string
direct
required
boolean
domain
required
string
offers_count
required
integer format: int32
protected
required
boolean
protection_window_seconds
required
integer format: int64
published_at
required
string format: date-time
sequence
required
integer format: int64
status
required
string | null
target_id
required
integer | null format: int64
target_kind
required
string | null
url
required
string
null
sequence
required
integer format: int64
slug
required
string
status
required
string | null
target_id
required
integer | null format: int64
updated_at
required
string format: date-time
updated_by
required
workspace_id
required
integer format: int64
Example
{ "content": { "blocks": [ { "align": "start", "button": { "style": "filled" }, "list": { "style": "bullets" } } ], "theme": { "font": "sans" } }, "created_by": { "kind": "user" }, "release": { "status": "live", "target_kind": "hosted" }, "status": "draft", "updated_by": { "kind": "user" }}default
Section titled “default”An error, as go-commons apperr maps it
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
Example generated
{ "error": { "code": "example", "fields": { "additionalProperty": "example" }, "message": "example" }}