Content
Content types and their entries (D326).
| Operation | Method and path | Scope |
|---|---|---|
| List content types | GET /content-types | content:read |
| List a type's entries | GET /content-types/{id}/entries | content:read |
| Get an entry | GET /content-entries/{id} | content:read |
| Create an entry | POST /content-types/{id}/entries | content:write |
| Save an entry's draft | PATCH /content-entries/{id} | content:write |
| Publish an entry | POST /content-entries/{id}/publish | content:publish |
List content types
GET https://kaizenaflow.com/api/admin/v1/content-types
The store's content types (D326) in their order, each with its fields.
Operation:
content.typesScope:
content:read, orcontent:write, which reads tooAnswers:
200, the answer underdata.
Answer
| Field | Type | Description |
|---|---|---|
data | list of objects | |
data[].id | string (uuid) | |
data[].key | string | |
data[].name | string | |
data[].slug | string | |
data[].fields | list of any | The type's fields as its page defines them. |
data[].has_pages | boolean | Its entries have pages of their own on the site. |
data[].entries | integer |
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. |
| 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/content-types' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-types", {
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/content-types",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)List a type's entries
GET https://kaizenaflow.com/api/admin/v1/content-types/{id}/entries
A content type's entries in the owner's order, each with its draft.
Operation:
content.entriesScope:
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. |
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[].type_id | string (uuid) | |
data[].slug | string | |
data[].state | one of draft, published, changed | |
data[].draft | map of string to any | The entry's draft: its fields' values (data) and its search texts. |
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. |
| 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 'https://kaizenaflow.com/api/admin/v1/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries", {
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/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Get an entry
GET https://kaizenaflow.com/api/admin/v1/content-entries/{id}
One entry with its draft.
Operation:
content.entryScope:
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.type_id | string (uuid) | |
data.slug | string | |
data.state | one of draft, published, changed | |
data.draft | map of string to any | The entry's draft: its fields' values (data) and its search texts. |
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. |
| 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/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-entries/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/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Create an entry
POST https://kaizenaflow.com/api/admin/v1/content-types/{id}/entries
Makes an entry of the type as a draft, its values checked by the type's fields as the entry page checks them.
Operation:
content.entry_createScope:
content:writeAnswers:
201, made: 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 |
|---|---|---|---|
slug | string, at most 120 characters | yes | Its address: lowercase letters, digits and single hyphens. |
fields | map of string to any | no, default {} | The change as the entry page sends it: values by field id, and translations per language of the fields written in words; a field left out stays. Checked by the type's fields as the page checks them. |
seo | object | no | |
seo.title | string, at most 200 characters | yes | |
seo.description | string, at most 400 characters | yes |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.type_id | string (uuid) | |
data.slug | string | |
data.state | one of draft, published, changed | |
data.draft | map of string to any | The entry's draft: its fields' values (data) and its search texts. |
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. |
| 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/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"slug":"your-store"}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"slug": "your-store"
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/content-types/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/entries",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"slug": "your-store",
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Save an entry's draft
PATCH https://kaizenaflow.com/api/admin/v1/content-entries/{id}
Changes the entry's draft: the values given, laid over its draft as kept. Its address is not drafted: a published entry's changes on the site at once, so it takes the power content:publish too (else gated).
Operation:
content.entry_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 |
|---|---|---|---|
slug | string, at most 120 characters | no | Its address: lowercase letters, digits and single hyphens. |
fields | map of string to any | no, default {} | The change as the entry page sends it: values by field id, and translations per language of the fields written in words; a field left out stays. Checked by the type's fields as the page checks them. |
seo | object | no | |
seo.title | string, at most 200 characters | yes | |
seo.description | string, at most 400 characters | yes |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.type_id | string (uuid) | |
data.slug | string | |
data.state | one of draft, published, changed | |
data.draft | map of string to any | The entry's draft: its fields' values (data) and its search texts. |
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. |
| 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/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"slug":"your-store"}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"slug": "your-store"
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
method="PATCH",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"slug": "your-store",
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Publish an entry
POST https://kaizenaflow.com/api/admin/v1/content-entries/{id}/publish
Publishes the entry's draft: it needs a title and its type's required fields.
Operation:
content.entry_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 |
|---|---|---|---|
body | object | yes | Nothing: send {} or no body. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.type_id | string (uuid) | |
data.slug | string | |
data.state | one of draft, published, changed | |
data.draft | map of string to any | The entry's draft: its fields' values (data) and its search texts. |
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. |
| 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/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/content-entries/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/publish",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)