Skip to content
Kaizena FlowDocs
Search

Search the docs

Blog

The store's blog articles (D57, D341), as pages are.

OperationMethod and pathScope
List blog articlesGET /articlescontent:read
Get a blog articleGET /articles/{id}content:read
Create a draft blog articlePOST /articlescontent:write
Save a blog article's draftPATCH /articles/{id}content:write
Publish a blog articlePOST /articles/{id}/publishcontent:publish

List blog articles

GET https://kaizenaflow.com/api/admin/v1/articles

The store's blog articles, the most recently changed first, each with whether its draft is published.

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[].titlestring
data[].slugstringIts address on the site, after the store's (a page) or blog/ (an article).
data[].stateone of draft, published, changeddraft: never published. published: the site shows the draft as it is. changed: the draft has changes not published.
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.
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/articles' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/articles", {
  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/articles",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Get a blog article

GET https://kaizenaflow.com/api/admin/v1/articles/{id}

One blog article with its draft as the editor keeps it.

Path parameters

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

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.titlestring
data.slugstringIts address on the site, after the store's (a page) or blog/ (an article).
data.stateone of draft, published, changeddraft: never published. published: the site shows the draft as it is. changed: the draft has changes not published.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)
data.draftmap of string to anyThe page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole.

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/articles/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/articles/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/articles/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 blog article

POST https://kaizenaflow.com/api/admin/v1/articles

Makes a blog article 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.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
draftmap of string to anyyesThe 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

FieldTypeDescription
dataobject
data.idstring (uuid)
data.titlestring
data.slugstringIts address on the site, after the store's (a page) or blog/ (an article).
data.stateone of draft, published, changeddraft: never published. published: the site shows the draft as it is. changed: the draft has changes not published.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)
data.draftmap of string to anyThe page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole.

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.
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/articles' \
  -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/articles", {
  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/articles",
    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 blog article's draft

PATCH https://kaizenaflow.com/api/admin/v1/articles/{id}

Saves the blog article'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.

  • Operation: articles.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
draftmap of string to anyyesThe 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

FieldTypeDescription
dataobject
data.idstring (uuid)
data.titlestring
data.slugstringIts address on the site, after the store's (a page) or blog/ (an article).
data.stateone of draft, published, changeddraft: never published. published: the site shows the draft as it is. changed: the draft has changes not published.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)
data.draftmap of string to anyThe page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole.

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/articles/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/articles/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/articles/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 blog article

POST https://kaizenaflow.com/api/admin/v1/articles/{id}/publish

Publishes the blog article's draft through the editor's own publish: its checks run, and a blocking issue not acknowledged is refused as conflict naming it.

Path parameters

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

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
acknowledged_issueslist of string, at most 200 characters, at most 100 itemsnoThe 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

FieldTypeDescription
dataobject
data.idstring (uuid)
data.titlestring
data.slugstringIts address on the site, after the store's (a page) or blog/ (an article).
data.stateone of draft, published, changeddraft: never published. published: the site shows the draft as it is. changed: the draft has changes not published.
data.published_atstring (date-time) or null
data.updated_atstring (date-time)
data.draftmap of string to anyThe page as the editor keeps it (its words, rows and blocks, search texts, categories): what PATCH takes back whole.

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/articles/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/articles/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/articles/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)

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

Was this page helpful?