Create, edit or delete a classification group
Create a classification group such as Categories, change its shared key or title, or remove the group. To add Culture to Categories, use the term endpoint.
| Task | Operation |
|---|---|
| Create Categories | POST /api/v1/admin/taxonomies |
| Change a group key or title | PUT /api/v1/admin/taxonomies/{key} |
| Delete a group | DELETE /api/v1/admin/taxonomies/{key} |
Before you start
Allowed roles: support, admin, partner; root is also permitted. Send the assigned token and publication key. readonly/manager and service accounts cannot write; full_access does not enable these routes. Keep calls in trusted server code. Caller activation, session and current publication-relationship restrictions apply.
| Input | Location / type | Meaning |
|---|---|---|
| resource | Required header, publication public-key string | Selects the publication; not a numeric taxonomy ID or secret. |
| token | Required header, existing eligible token string | ADMIN_TOKEN in examples. |
| key | POST/PUT body text; PUT/DELETE path text | Taxonomy key within the selected publication, not a term key or numeric ID. |
For a title edit, send the current key in URL and body. For a key rename, use the old URL key and new body key, then update consumers of the old key. terms input is ignored; the response shows current selected terms.
A request can save changes before a later error. A completed response does not confirm every save. Inspect stored configuration before repeating; there is no full rollback, access-queue or cache-propagation guarantee.
Examples use fictional group 7101/category and term 7201/culture in separate scenarios. Use intended plain keys; there is no automatic lowercase/slug conversion or general slash/encoded-key routing guarantee. Requests use cURL, Node.js 18+ fetch in an ES module (.mjs), and Python 3 urllib. Set WALLKIT_API_BASE to scheme and host only, plus RESOURCE_KEY and ADMIN_TOKEN. See shared errors.
Create Categories
POST /api/v1/admin/taxonomies
Create a publication group without creating or attaching terms.
Request
Send JSON with Content-Type: application/json using a key not already used here. Filter, pagination and sort are ignored.
| Body field | Type / requirement | Meaning and constraints |
|---|---|---|
| key | Required text | Intended group key, sanitized and trimmed. |
| title | Required text | Shared group label; sanitized and trimmed before storage. |
Send plain nonblank fields: required-presence checks occur before trimming. Do not depend on generated fallback values.
Example: Create the group without terms
Assume category is unused and new ID 7101 is returned. Empty terms shows selected links for the new group.
curl "${WALLKIT_API_BASE}/api/v1/admin/taxonomies" \
-X POST \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"key":"category","title":"Categories"}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/taxonomies`);
const response = await fetch(url, {
method: "POST",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
body: JSON.stringify({"key": "category", "title": "Categories"})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/taxonomies"
body = json.dumps({'key': 'category', 'title': 'Categories'}).encode("utf-8")
request = Request(
url,
data=body,
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
method="POST"
)
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 201 response:
{
"id": 7101,
"key": "category",
"title": "Categories",
"terms": []
}
See field meanings. Keep the returned key for later edits/lookups.
Alternative: The key already exists
HTTP 404 response:
{
"error": "invalid_taxonomy_key",
"error_description": "Taxonomy key exists",
"req_guid": "synthetic-request-reference"
}
This duplicate-key 404 differs from taxonomy_not_exists; the group is not missing.
Recovery and next task
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 406 | incorrect_data / Body must be json format | Missing JSON or a value treated as empty by the API. | Send the intended JSON object. |
| 409 | invalid_key or invalid_title / validation message | Required field fails presence validation. | Supply both plain key and title. |
| 404 | invalid_taxonomy_key / Taxonomy key exists | Proposed key already matches a group in the publication. | Inspect the existing group before choosing create or edit. |
| Varies / no guaranteed JSON | Save, query, method, runtime or transport failure | Errors can use different response formats. | Retain diagnostics and inspect stored configuration before retrying. |
Read the taxonomy for terms, or edit the title.
Edit a group title or key
PUT /api/v1/admin/taxonomies/{key}
Edit the shared group by trimmed publication key. Both key and title are required, even for title-only changes.
Request
Send JSON with Content-Type: application/json for the known group. Filter, pagination and sort are ignored.
| Input | Location / type / requirement | Meaning and constraints |
|---|---|---|
| key | Path text; required | Existing stored taxonomy key, sanitized and trimmed for lookup. |
| key | Body text; required | Intended group key. For a title edit, send the exact existing value. |
| title | Body text; required | Intended shared group title, sanitized and trimmed. |
A raw key change triggers duplicate lookup after trimming. Whitespace variations can collide with the same record; use exact stored spelling for title-only changes. terms cannot add, remove or edit terms here.
Example: Keep category and change Categories to Article categories
Assume category already links Culture. Send the current key and new shared title; the term stays unchanged.
curl "${WALLKIT_API_BASE}/api/v1/admin/taxonomies/category" \
-X PUT \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"key":"category","title":"Article categories"}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/taxonomies/category`);
const response = await fetch(url, {
method: "PUT",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
body: JSON.stringify({"key": "category", "title": "Article categories"})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/taxonomies/category"
body = json.dumps({'key': 'category', 'title': 'Article categories'}).encode("utf-8")
request = Request(
url,
data=body,
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
method="PUT"
)
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response:
{
"id": 7101,
"key": "category",
"title": "Article categories",
"terms": [
{
"id": 7201,
"key": "culture",
"title": "Culture"
}
]
}
The field meanings show the same group ID and term, not a new group or term edit.
Alternative: The proposed key collides
HTTP 404 response:
{
"error": "invalid_taxonomy_key",
"error_description": "Taxonomy key exists",
"req_guid": "synthetic-request-reference"
}
The proposed key collided. A missing URL key instead returns taxonomy_not_exists / Taxonomy not found.
Recovery and next task
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 406 | incorrect_data / Body must be json format | Missing JSON or a value treated as empty by the API. | Send a JSON object containing both required fields. |
| 404 | taxonomy_not_exists / Taxonomy not found | No group matches path key and publication. | Check the existing stored key and publication. |
| 409 | invalid_key or invalid_title / validation message | Required body field fails validation. | Include both key and title; use the existing key for a title edit. |
| 404 | invalid_taxonomy_key / Taxonomy key exists | Proposed key collides, including normalization-equivalent input. | Keep exact existing spelling or choose the intended available key. |
| Varies / no guaranteed JSON | Save, refresh, serialization, runtime or transport failure | A write can precede a later failure. | Inspect the group under its intended old/new key before retrying. |
Read the group to inspect label and terms. Edit term labels separately.
Delete a classification group
DELETE /api/v1/admin/taxonomies/{key}
Attempt to remove the known shared group from the selected publication.
Before you call
Review shared uses before removal. Depending on deployed database rules, removal can also remove group-term links and dependent content/Plan/event mappings. Separate Term records are not directly deleted. Check purchases and memberships separately before removal; the response does not confirm full cleanup, access revocation, refunds or completed cache/access updates.
Request
Send the stored group key and headers. Body, term array, filter, pagination and sort are ignored.
Example: Remove an intentionally disposable group
Assume the fictional category group exists.
curl "${WALLKIT_API_BASE}/api/v1/admin/taxonomies/category" \
-X DELETE \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/taxonomies/category`);
const response = await fetch(url, {
method: "DELETE",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN}
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/taxonomies/category"
request = Request(
url,
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]},
method="DELETE"
)
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response:
{
"result": true
}
| Field | Type / presence | Meaning |
|---|---|---|
| result | Literal boolean true if the response is reached | Fixed response value after the delete attempt. Inspect the stored group and affected mappings to confirm removal; this marker is not a per-record cleanup result. |
Alternative: The group is missing
HTTP 404 response:
{
"error": "taxonomy_not_exists",
"error_description": "Taxonomy not found",
"req_guid": "synthetic-request-reference"
}
No group matched this key/publication. Repeating after removal may return this error, not success.
Recovery and next task
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | taxonomy_not_exists / Taxonomy not found | No matching key/publication record. | Inspect known configuration; do not infer global absence. |
| 200 | result:true | Fixed reply after the delete attempt. | Inspect the stored group and affected mappings rather than treating this field as a cleanup audit. |
| Varies / no guaranteed JSON | Constraint, query, runtime, method or transport failure | Error formats can vary, and earlier changes may remain. | Keep diagnostics and inspect persisted state before retrying. |
Browse groups. That list excludes blank-title groups and cannot verify all dependent cleanup.
Read the create/update result
Create/update return taxonomy fields at the top level, without items/paginator:
| Field | Type / presence | Meaning |
|---|---|---|
| id | Numeric model identifier; selected, no explicit output cast | Taxonomy record ID, distinct from its key and the term/junction IDs. |
| key | Text; selected | Stored group key, including an accepted rename. Uniqueness is not global. |
| title | URL-decoded display text; selected | Shared group label. No universal decoder-pass or null-preservation guarantee. |
| terms[] | Array of objects; always present, including [] | Selected related terms. Its presence is response expansion, not evidence a request terms array was processed. |
| terms[].id | Numeric model identifier; selected, no explicit output cast | Term record ID. |
| terms[].key | Text; selected | Related term key; no universal encoded-key round-trip promise. |
| terms[].title | URL-decoded display text; selected | Related term label. |
Selected terms belong to this group/publication and have nonblank, nonnull stored titles. Empty terms can mean no links or only excluded rows. Order and uniqueness are unspecified. Rows have id/key/title, not Plan rules, link IDs or access results.