Pages
The store's pages (D42): drafts written through the editor's own save; publishing with content:publish.
| Operation | Method and path | Scope |
|---|---|---|
| List pages | GET /pages | content:read |
| Get a page | GET /pages/{id} | content:read |
| Create a draft page | POST /pages | content:write |
| Save a page's draft | PATCH /pages/{id} | content:write |
| Publish a page | POST /pages/{id}/publish | content:publish |
List pages
GET https://kaizenaflow.com/api/admin/v1/pages
The store's pages, the most recently changed first, each with whether its draft is published.
Operation:
pages.listScope:
content:read, orcontent:write, which reads tooAnswers:
200, the answer underdata.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
updated_after | string (date-time) | no | Only what was made or changed after this time (ISO 8601 with its offset), for incremental sync. |
Answer
| Field | Type | Description |
|---|---|---|
data | list of objects | |
data[].id | string (uuid) | |
data[].title | string | |
data[].slug | string | Its address on the site, after the store's (a page) or blog/ (an article). |
data[].state | one of draft, published, changed | draft: never published. published: the site shows the draft as it is. changed: the draft has changes not published. |
data[].published_at | string (date-time) or null | |
data[].updated_at | string (date-time) |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl 'https://kaizenaflow.com/api/admin/v1/pages' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/pages", {
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
},
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/pages",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Get a page
GET https://kaizenaflow.com/api/admin/v1/pages/{id}
One page with its draft as the editor keeps it.
Operation:
pages.getScope:
content:read, orcontent:write, which reads tooAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.title | string | |
data.slug | string | Its address on the site, after the store's (a page) or blog/ (an article). |
data.state | one of draft, published, changed | draft: never published. published: the site shows the draft as it is. changed: the draft has changes not published. |
data.published_at | string (date-time) or null | |
data.updated_at | string (date-time) | |
data.draft | map of string to any | The page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl 'https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
},
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Create a draft page
POST https://kaizenaflow.com/api/admin/v1/pages
Makes a page as a draft through the editor's own save and its checks; nothing is on the site until it is published. A draft that carries globalEdits is refused: global parts change in the admin.
Operation:
pages.createScope:
content:writeAnswers:
201, made: the answer underdata.Once only: with an
Idempotency-Keyheader.
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
draft | map of string to any | yes | The page as the editor keeps it, whole (read one with GET first); the editor's own checks run on it. It is saved as the draft; the site keeps what was published. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.title | string | |
data.slug | string | Its address on the site, after the store's (a page) or blog/ (an article). |
data.state | one of draft, published, changed | draft: never published. published: the site shows the draft as it is. changed: the draft has changes not published. |
data.published_at | string (date-time) or null | |
data.updated_at | string (date-time) | |
data.draft | map of string to any | The page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 409 | conflict | Nothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request. |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl -X POST 'https://kaizenaflow.com/api/admin/v1/pages' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"draft":{"example":"example"}}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/pages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"draft": {
"example": "example"
}
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/pages",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"draft": {
"example": "example",
},
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Save a page's draft
PATCH https://kaizenaflow.com/api/admin/v1/pages/{id}
Saves the page's draft whole through the editor's save; what the site shows stays as published until it is published again. A draft that carries globalEdits is refused: global parts, and the pages using them, change in the admin. A new address for a page never published also moves the pages under it at once: when one of them is published, that takes the power content:publish too (else gated).
Operation:
pages.updateScope:
content:writeAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
draft | map of string to any | yes | The page as the editor keeps it, whole (read one with GET first); the editor's own checks run on it. It is saved as the draft; the site keeps what was published. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.title | string | |
data.slug | string | Its address on the site, after the store's (a page) or blog/ (an article). |
data.state | one of draft, published, changed | draft: never published. published: the site shows the draft as it is. changed: the draft has changes not published. |
data.published_at | string (date-time) or null | |
data.updated_at | string (date-time) | |
data.draft | map of string to any | The page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 403 | gated | The request needs a power beside the operation's scope (the message names it): changing a product, category or address on the site, an import that would, or a customer's email. A copied order is never changed. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl -X PATCH 'https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"draft":{"example":"example"}}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"draft": {
"example": "example"
}
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
method="PATCH",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"draft": {
"example": "example",
},
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Publish a page
POST https://kaizenaflow.com/api/admin/v1/pages/{id}/publish
Publishes the page's draft through the editor's own publish: its checks run, and a blocking issue not acknowledged is refused as conflict naming it.
Operation:
pages.publishScope:
content:publishAnswers:
200, the answer underdata.Once only: with an
Idempotency-Keyheader.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
acknowledged_issues | list of string, at most 200 characters, at most 100 items | no | The checker's blocking issues (their ids) the owner has seen and publishes with; a publish with an issue not named is refused as conflict with the issues. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.title | string | |
data.slug | string | Its address on the site, after the store's (a page) or blog/ (an article). |
data.state | one of draft, published, changed | draft: never published. published: the site shows the draft as it is. changed: the draft has changes not published. |
data.published_at | string (date-time) or null | |
data.updated_at | string (date-time) | |
data.draft | map of string to any | The page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | conflict | Nothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request. |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl -X POST 'https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"acknowledged_issues":["example"]}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"acknowledged_issues": [
"example"
]
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/pages/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"acknowledged_issues": [
"example",
],
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)