Skip to content
Kaizena FlowDocs
Search

Search the docs

Content

Content types and their entries (D326).

OperationMethod and pathScope
List content typesGET /content-typescontent:read
List a type's entriesGET /content-types/{id}/entriescontent:read
Get an entryGET /content-entries/{id}content:read
Create an entryPOST /content-types/{id}/entriescontent:write
Save an entry's draftPATCH /content-entries/{id}content:write
Publish an entryPOST /content-entries/{id}/publishcontent: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.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].keystring
data[].namestring
data[].slugstring
data[].fieldslist of anyThe type's fields as its page defines them.
data[].has_pagesbooleanIts entries have pages of their own on the site.
data[].entriesinteger

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Query parameters

NameTypeRequiredDescription
updated_afterstring (date-time)noOnly what was made or changed after this time (ISO 8601 with its offset), for incremental sync.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].type_idstring (uuid)
data[].slugstring
data[].stateone of draft, published, changed
data[].draftmap of string to anyThe entry's draft: its fields' values (data) and its search texts.
data[].published_atstring (date-time) or null
data[].updated_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing 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.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.type_idstring (uuid)
data.slugstring
data.stateone of draft, published, changed
data.draftmap of string to anyThe entry's draft: its fields' values (data) and its search texts.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
slugstring, at most 120 charactersyesIts address: lowercase letters, digits and single hyphens.
fieldsmap of string to anyno, 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.
seoobjectno
seo.titlestring, at most 200 charactersyes
seo.descriptionstring, at most 400 charactersyes

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.type_idstring (uuid)
data.slugstring
data.stateone of draft, published, changed
data.draftmap of string to anyThe entry's draft: its fields' values (data) and its search texts.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing 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.
422invalidNothing 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.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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_update

  • Scope: content:write

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
slugstring, at most 120 charactersnoIts address: lowercase letters, digits and single hyphens.
fieldsmap of string to anyno, 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.
seoobjectno
seo.titlestring, at most 200 charactersyes
seo.descriptionstring, at most 400 charactersyes

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.type_idstring (uuid)
data.slugstring
data.stateone of draft, published, changed
data.draftmap of string to anyThe entry's draft: its fields' values (data) and its search texts.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
403gatedThe 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.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing 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.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
bodyobjectyesNothing: send {} or no body.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.type_idstring (uuid)
data.slugstring
data.stateone of draft, published, changed
data.draftmap of string to anyThe entry's draft: its fields' values (data) and its search texts.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe 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.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing 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.
422invalidNothing 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.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething 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)

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?