Skip to content
Kaizena FlowDocs
Search

Search the docs

Forms

The store's forms (D705): read, made and changed with forms:write; their responses read with the right to read customers.

OperationMethod and pathScope
List formsGET /formsforms:read
Get a formGET /forms/{id}forms:read
List a form's responsesGET /forms/{id}/responsesforms:read
Make a formPOST /formsforms:write
Change a formPATCH /forms/{id}forms:write

List forms

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

The store's forms (D705), archived last, newest change first, with their responses counted.

  • Operation: forms.list

  • Scope: forms:read, or forms:write, which reads too

  • Answers: 200, the answer under data.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].namestringThe owner's name for it; never shown on the site.
data[].kindone of message, signupA message form, or a newsletter sign-up.
data[].statusone of active, archivedarchived: it shows nothing on the site and takes no responses.
data[].questionsintegerHow many questions it asks (a sign-up's own email and name not counted).
data[].responsesinteger
data[].unreadintegerResponses not yet opened in the admin.
data[].last_response_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.
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/forms' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

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

Get a form

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

One form with its draft: what it asks, its words in every language, who it emails and how long it keeps responses.

  • Operation: forms.get

  • Scope: forms:read, or forms:write, which reads too

  • Answers: 200, the answer under data.

Path parameters

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

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestringThe owner's name for it; never shown on the site.
data.kindone of message, signupA message form, or a newsletter sign-up.
data.statusone of active, archivedarchived: it shows nothing on the site and takes no responses.
data.questionsintegerHow many questions it asks (a sign-up's own email and name not counted).
data.responsesinteger
data.unreadintegerResponses not yet opened in the admin.
data.last_response_atstring (date-time) or null
data.updated_atstring (date-time)
data.made_fromstring or nullstarter:{key} or template:{id}: what it was made from. Never a link that changes it.
data.draftmap of string to anyThe form as the editor keeps it (kind, name, questions with their words per language, words, delivery, signup, keepMonths): 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/forms/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/forms/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/forms/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

List a form's responses

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

What visitors sent with the form, newest first, as the Responses tab shows them. A response is a person's data: it needs the right to read customers, and goes after the form's own months.

  • Operation: forms.responses

  • Scope: forms:read, or forms:write, which reads too

  • Answers: 200, a page: the rows under data, and next for the page after.

  • Pages: at most 100 rows, 50 when limit is left out; give an answer's next as ?after= for the page after.

Path parameters

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

Query parameters

NameTypeRequiredDescription
limitinteger, 1 to 100noRows a page holds, at most 100; 50 when left out. A larger number gives 100.
afterstring, at most 200 charactersnoThe next cursor of the page before; the first page when left out.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].answerslist of objectsWhat the visitor answered, labelled in the owner's language, in the form's order.
data[].answers[].labelstring
data[].answers[].valuestring
data[].contact_emailstring or nullThe first email address answered, lower case.
data[].pathstringThe page it was sent from.
data[].localestring
data[].stateone of new, read, archived
data[].deliveryone of sent, logged, failed, inboxHow it reached the store: emailed (sent, or only logged without email settings), the email failed, or the support inbox.
data[].created_atstring (date-time)
nextstring or nullThe cursor of the next page, given as ?after=; null on the last page.

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

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/forms/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/responses", {
  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/forms/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/responses",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Make a form

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

Makes a form from a template, or whole from a draft. It shows on the site only once a page's Form component places it.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
template_idstring (uuid)noA form template the store may use (its own, its owner's other stores', Kaizena Flow's or the marketplace's): the form is made from it in the store's languages, sending to the store's contact address.
draftmap of string to anynoThe form whole, as GET answers its draft; the editor's own checks run on it.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestringThe owner's name for it; never shown on the site.
data.kindone of message, signupA message form, or a newsletter sign-up.
data.statusone of active, archivedarchived: it shows nothing on the site and takes no responses.
data.questionsintegerHow many questions it asks (a sign-up's own email and name not counted).
data.responsesinteger
data.unreadintegerResponses not yet opened in the admin.
data.last_response_atstring (date-time) or null
data.updated_atstring (date-time)
data.made_fromstring or nullstarter:{key} or template:{id}: what it was made from. Never a link that changes it.
data.draftmap of string to anyThe form as the editor keeps it (kind, name, questions with their words per language, words, delivery, signup, keepMonths): 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/forms' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"template_id":"41872e6b-c6f6-44b6-9980-f2f41db16bc9"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/forms", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "template_id": "41872e6b-c6f6-44b6-9980-f2f41db16bc9"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/forms",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "template_id": "41872e6b-c6f6-44b6-9980-f2f41db16bc9",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Change a form

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

Saves the form's draft whole: a page that places it shows the change at once.

  • Operation: forms.update

  • Scope: forms: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 form whole, as GET answers its draft (read it first); its kind never changes. The editor's own checks run on it.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestringThe owner's name for it; never shown on the site.
data.kindone of message, signupA message form, or a newsletter sign-up.
data.statusone of active, archivedarchived: it shows nothing on the site and takes no responses.
data.questionsintegerHow many questions it asks (a sign-up's own email and name not counted).
data.responsesinteger
data.unreadintegerResponses not yet opened in the admin.
data.last_response_atstring (date-time) or null
data.updated_atstring (date-time)
data.made_fromstring or nullstarter:{key} or template:{id}: what it was made from. Never a link that changes it.
data.draftmap of string to anyThe form as the editor keeps it (kind, name, questions with their words per language, words, delivery, signup, keepMonths): 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).
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/forms/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/forms/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/forms/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)

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

Was this page helpful?