Create, update or delete content metadata
Register an article’s metadata, update it by content key or delete its Wallkit record. To register an article and decide whether a reader can see it in the same request, use the content access guide.
| Task | Operation | Eligible caller |
|---|---|---|
| Create metadata | POST /api/v1/admin/content | support, admin or partner, or root |
| Update metadata | PUT /api/v1/admin/content/{key} | support, admin or partner, or root |
| Delete metadata | DELETE /api/v1/admin/content/{key} | support, admin or partner, or root |
Context and examples
Allowed roles: support, admin, partner; root is also permitted. Send the assigned token and publication key. Unlike Plan/subscription create, support can create content. readonly/manager and service accounts cannot write here. full_access does not enable these routes. Keep calls in trusted server code.
| Input | Location / type | Meaning |
|---|---|---|
| resource | Required header, publication public-key string | Selects the publication, not a numeric record ID or secret. |
| token | Required header, existing eligible token string | ADMIN_TOKEN in examples. |
| key | POST body text; PUT/DELETE path text | Stored content key within the selected publication, not numeric content ID. |
The caller must be active; their current publication relationship, when present, must not be locked or suspended. Session checks can reject revoked, expired or compromised tokens. Choose the intended content record in the selected publication.
Examples use fictional content 9001, key example-article and configured type article. They are separate scenarios: create assumes a new key and existing type; update assumes a record; delete assumes database constraints permit removal. Responses are illustrative. 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. example.com URLs are stored metadata. See shared errors.
Identity and replacement boundaries
Use the stored key for update/delete. Create trims and URL-decodes the body key; path lookups trim it and use a publication cache without the same extra decode. A plain key such as example-article avoids ambiguity. PUT ignores body key, id and resource_id.
Empty update images/taxonomies arrays keep existing sets; nonempty arrays replace them.
| Input | Effect |
|---|---|
| images omitted, null or [] | Update does not invoke the image helper; existing images remain. |
| images nonempty | Deletes the content's old image rows, then creates the supplied rows. Not a merge or a guaranteed atomic replacement. |
| taxonomies omitted, null or [] | Update does not invoke the taxonomy helper; existing mappings remain. |
| taxonomies nonempty | Removes old content-term links, then processes supplied taxonomy/term rows. A nonempty array whose taxonomy keys are all skipped can clear links. |
| Shared classification metadata | Helpers can create publication types, taxonomies and terms. Nonempty taxonomy titles can rename a shared group; term titles are assigned even for existing terms, so omission is not a preservation guarantee. |
| extra | A supplied update object replaces the whole extra value, not selected properties. Create uses different object-casting behavior described below. |
Classification links are separate from Plan rules, reader labels and access grants. Replacement does not explicitly delete shared type/group/term records. Send complete nonempty sets only when replacement is intended; the examples omit them.
Read current metadata before repeating an uncertain write. Create can fail without explicit rollback or after commit. Update saves the record before replacing links/images, so some changes may remain.
Create content metadata
POST /api/v1/admin/content
Create a content record under the selected publication key.
Before you call
Send an allowed token and publication key. Use an intended plain key/type. Create URL-decodes the body key; update/delete do not add that decode. Do not assume generated keys or arbitrary encoded routing.
Read replacement and failure behavior before adding links/images. Types can be created and shared labels changed. The example assumes an existing type and omits link arrays. Metadata creation does not publish or grant access.
Request
Send JSON with required key, price, currency and content_type presence, plus optional fields. Title has the maximum length described in the field table. This metadata write has no pagination, filter or sort options.
Response
HTTP 201 returns content metadata. After commit, access-queue, admin-event and response work can fail; success does not confirm recalculation or live publication.
Example: Create plain metadata without relationship arrays
Assume article exists and USD is configured. ID 9001/timestamps are illustrative. published_at:null shows an unset value, not a guaranteed default. New images/taxonomies are empty.
curl "${WALLKIT_API_BASE}/api/v1/admin/content" \
-X POST \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"key":"example-article","title":"Example article","description":"Illustrative metadata.","price":500,"currency":"USD","content_type":"article","extra":{"label":"example"},"link":"https://example.com/articles/example-article","is_applied_vat":false,"vat_percent":0}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/content`);
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": "example-article", "title": "Example article", "description": "Illustrative metadata.", "price": 500, "currency": "USD", "content_type": "article", "extra": {"label": "example"}, "link": "https://example.com/articles/example-article", "is_applied_vat": false, "vat_percent": 0})
});
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/content"
body = json.dumps({'key': 'example-article', 'title': 'Example article', 'description': 'Illustrative metadata.', 'price': 500, 'currency': 'USD', 'content_type': 'article', 'extra': {'label': 'example'}, 'link': 'https://example.com/articles/example-article', 'is_applied_vat': False, 'vat_percent': 0}).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:
{
"key": "example-article",
"title": "Example article",
"description": "Illustrative metadata.",
"price": 500,
"currency": "USD",
"extra": {
"label": "example"
},
"link": "https://example.com/articles/example-article",
"created_at": "2026-11-01 12:00:00",
"updated_at": "2026-11-01 12:00:00",
"published_at": null,
"images": [],
"is_payable_content": true,
"id": 9001,
"is_applied_vat": false,
"vat_percent": 0,
"content_type": "article",
"taxonomies": []
}
Alternative: Key already exists
HTTP 409 response:
{
"error": "invalid_key",
"error_description": "Content key exists",
"req_guid": "synthetic-request-reference"
}
The duplicate check precedes creation. Later errors can follow writes or commit.
Recovery
| 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 with required fields. |
| 409 | invalid_{field}, invalid_image_{field}, invalid_published_at | Field, image URL or date validation. | Correct the reported constraint; do not infer a network check or universal date assignment. |
| 409 | invalid_key / Content key exists | Normalized key already stored in publication. | Inspect the intended existing content before choosing another action. |
| 409 | term_empty / Term not set | Processed taxonomy has no terms, possibly after writes. | Inspect state and intended complete mappings before resubmitting. |
| 406 | create_content_fail, create_taxonomy_fail, create_term_fail / message | Save or classified helper failure. Saved changes may remain after failure. | Retain reference and inspect persisted content/shared metadata; no unchanged-state guarantee. |
| 409 / varies | exception / message, or uncaught/runtime/transport failure | Other failure, potentially after commit/queue attempts. | Inspect stored state before retrying; no atomicity or completed-work guarantee. |
See shared errors. Read detail to inspect saved metadata.
Update metadata by content key
PUT /api/v1/admin/content/{key}
Update a known record in the selected publication.
Before you call
Send an allowed token, publication key and stored key. Omitted/null/empty images and taxonomies preserve; nonempty arrays replace after old rows/links are removed. An all-skipped nonempty taxonomy set can clear links. Shared labels/types and whole-extra replacement follow write behavior.
Path lookup trims and uses cache without POST’s extra decode. Body key cannot rename; PUT ignores published_at. Empty raw keys, including string 0, can return a different error format from read’s 404. Use a known path segment; cached results may lag.
Request
Send a JSON object and follow field-specific rules for title, price, currency and link. Supply valid nonempty image URLs and inspect their stored values after replacement. This write has no pagination, filter or sort options. The example omits links/type/date and replaces extra.
Response
HTTP 200 returns metadata. Base/type/shared-label changes are not in one transaction with later set replacement. Queue/event attempts do not confirm delivery, publication or access recalculation; an error can follow saved changes.
Example: Change display metadata and replace extra
Assume existing fields match the create example with no links. extra becomes {label:revised}; old omitted keys are removed. Omitted link arrays leave them unchanged.
curl "${WALLKIT_API_BASE}/api/v1/admin/content/example-article" \
-X PUT \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data '{"title":"Example revised article","description":"Revised illustrative metadata.","extra":{"label":"revised"}}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/content/example-article`);
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({"title": "Example revised article", "description": "Revised illustrative metadata.", "extra": {"label": "revised"}})
});
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/content/example-article"
body = json.dumps({'title': 'Example revised article', 'description': 'Revised illustrative metadata.', 'extra': {'label': 'revised'}}).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:
{
"key": "example-article",
"title": "Example revised article",
"description": "Revised illustrative metadata.",
"price": 500,
"currency": "USD",
"extra": {
"label": "revised"
},
"link": "https://example.com/articles/example-article",
"created_at": "2026-11-01 12:00:00",
"updated_at": "2026-11-01 12:05:00",
"published_at": null,
"images": [],
"is_payable_content": true,
"id": 9001,
"is_applied_vat": false,
"vat_percent": 0,
"content_type": "article",
"taxonomies": []
}
Alternative: No matching content
HTTP 404 response:
{
"error": "content_not_exists",
"error_description": "Content not found",
"req_guid": "synthetic-request-reference"
}
No nonempty key matched this publication. Empty-key failures can differ; this does not establish global absence.
Recovery
| 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. |
| 404 | content_not_exists / Content not found | No record matches key and publication. | Check the known plain stored key/publication; do not substitute numeric ID or body key. |
| 409 | invalid_{field}; invalid_images / Param url in images object required. | Scalar validation or falsy image URL. | Supply valid nonempty image URLs and inspect current images before retrying. |
| 409 | term_empty / Term not set | Missing terms after a processed taxonomy. | Inspect persisted base/shared records and mappings; replacement may have begun. |
| 406 | create_content_fail / model message | Content save returned false, even though this is PUT. | Keep the error reference and inspect state before retrying. |
| 500 / varies | exception / message, or uncaught/runtime/transport failure | Lookup/helper/cache/serialization failure or other error. Falsy-key/method branches are not uniformly normalized here. | Inspect persisted content/images/classification before retrying; no rollback or unchanged-state promise. |
See shared errors. Read saved metadata and compare intended fields/links.
Delete content metadata by key
DELETE /api/v1/admin/content/{key}
Attempt destructive content-record deletion in the selected publication.
Before you call
Send an allowed token, publication key and intended key. Review purchases, memberships and other dependencies before deleting the content record. Deployed database constraints or cascades can affect removal and related records; the subscription catalog’s guarded-delete behavior is a separate contract.
Lookup uses trimmed cached key/publication context without POST’s extra decode. Empty/string 0 keys can return a different error format from the failures listed below. Do not use this operation to refund payments, manage reader access, cancel subscriptions, remove files, or migrate history; handle those tasks separately. Inspect state before retrying; removal is not guaranteed atomic or safely repeatable.
Request
Send the stored key and headers without a body, rather than a numeric ID. There are no pagination, filter or sort options. Check reader access separately after removal; admin events and cache invalidation do not confirm downstream completion or recalculation.
Response
HTTP 200 returns this result, apart from shared metadata:
| Field | Type / presence | Meaning |
|---|---|---|
| result | Boolean; added | Content model delete result, not an exhaustive related-record cleanup report or reader-access/refund/file-removal result. False is possible without an exception. |
Example: Delete intentionally disposable metadata
Assume the fictional record exists and database constraints allow removal.
curl "${WALLKIT_API_BASE}/api/v1/admin/content/example-article" \
-X DELETE \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/content/example-article`);
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/content/example-article"
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
}
Alternative: Content not found
HTTP 404 response:
{
"error": "content_not_exists",
"error_description": "Content not found",
"req_guid": "synthetic-request-reference"
}
Already removed records can return this error rather than another success. This does not establish global absence.
Recovery
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | content_not_exists / Content not found | No known key/publication record, including a prior deletion. | Inspect known configuration; do not retry deletion blindly. |
| 200 | result:false | Model delete returned false. | Inspect the stored record and reported diagnostics before deciding another action. |
| 500 | incorrect_method / Incorrect method | Wrong method if this action is reached. | Use the registered DELETE route; no alternative method behavior is promised. |
| 500 / varies | exception / message or uncaught/runtime/transport failure | Constraint/snapshot/cache/event/serialization error, possibly after deletion; key lookup failures can use different response formats. | Keep request reference and inspect persisted state/dependencies. Do not infer rollback, complete cascades or refunds/revocation. |
See shared errors. Browse metadata to inspect remaining records.
Scalar input fields
Send a JSON object. Presence, assignment and null rules differ by field and operation.
| Field | Input / validation | Create and update behavior |
|---|---|---|
| key | Required on POST, maximum 50 characters before normalization | POST string/trim/URL-decode; duplicate key in selected publication rejected. If normalization leaves an empty key and saving proceeds, the model has a generated-key fallback; do not rely on it as an identity recipe. PUT body key is ignored. |
| title | Text; maximum 500 | Stored after string/tag stripping/trim/URL-decode. POST reads it even when omitted, without a universal omitted/null result guarantee. PUT assigns when nonnull; omission/null avoids assignment. |
| description | Stored value | POST uses supplied value or null; PUT assigns when nonnull. Omitted/null PUT does not establish a clear instruction. |
| price | Required on POST; use numeric input | Both assign a supplied nonnull value using amount normalization below. On update, omission/null preserves the price; 0 or empty text can overwrite it. Supply the intended nonnegative amount and inspect the saved price. |
| currency | Required configured currency on POST; update validates only nonempty nonnull values | Stored string without automatic uppercase conversion. Omitted/null update preserves; empty values do not establish validated currency. |
| content_type | Required presence on POST; binding requires nonempty string | Publication type lookup or creation. PUT nonempty string reassigns/resolves a type; empty/null/nonstring does not explicitly clear the existing type. No closed type enum or universal malformed-type rejection. |
| extra | Create object-casts supplied value or empty fallback; update requires an object | POST omitted/null becomes empty object; arrays/scalars are object-cast rather than uniformly rejected. PUT whole-object replacement; array/scalar/null is ignored by this assignment. No closed property schema. |
| link | POST URL validation when nonnull; PUT URL validation only when nonempty/nonnull | POST stores trimmed URL-decoded value; PUT trims without that decode filter. Neither validates network reachability or fetches the target. |
| is_applied_vat, vat_percent | Boolean filtering / float filtering when nonnull | Stored settings, rather than a tax calculation. Supply the intended percentage. Omitted/null update avoids assignment. |
| published_at | POST nonempty value checked with date parsing | Assignment also requires a positive integer interpretation of the raw value; accepted parsing alone does not guarantee assignment. Stored format Y-m-d H:i:s, timezone unspecified. PUT ignores this field entirely. |
For published_at, parsing alone does not ensure assignment. Accepted dates, relative phrases or Unix-like values can behave differently; omission does not mean publish now. Assignment has a current-time fallback if parsing fails, but it is not a general default.
price is filtered to float, then text. A decimal point in that filtered text triggers multiplication by 100, rounding and integer conversion; otherwise rounding occurs without multiplication. The filtered value matters, not original JSON spelling. There is no universal major/minor input unit or currency conversion. The example uses integer-form 500 and stored price 500.
Use JSON booleans. After string/lowercase/trim filtering, empty values and literal false become false; nonempty off does not. is_payable_content describes positive stored price, not reader permission.
Image and taxonomy input details
Images are stored metadata, not uploaded or fetched files.
| Image field | Input / presence | Meaning and limits |
|---|---|---|
| url | Required for a processed row | Send a valid nonempty URL string. Update stores trimmed URL text. Image URLs are stored metadata; the target is not fetched. |
| width, height | Optional; assigned only when nonnull and truthy, integer-filtered | Stored dimensions. Use intended integer dimensions; 0/empty does not assign a dimension. No unit conversion is specified. |
| title | Optional nonempty text | Can be stored on image rows but is omitted from the selected response. |
Nonempty update images removes old rows before creating new ones. IDs/timestamps may change. No deduplication, file removal or atomic replacement is guaranteed.
| Classification input | Input / presence | Effect |
|---|---|---|
| taxonomies[].key | Text; missing/falsy key skipped | Sanitized/trimmed/URL-decoded for current-publication lookup or creation. Skipped entries in a nonempty replacement still follow old-link removal. |
| taxonomies[].title | Optional nonempty text | Can update the shared publication taxonomy title. |
| taxonomies[].terms[] | Nonempty array for a processed taxonomy | Missing/empty terms returns term_empty after shared taxonomy save and possible old-link removal. |
| terms[].key | Required field for each processed term | Sanitized/trimmed/URL-decoded; current-publication lookup or creation. |
| terms[].title | Provide intended text | Always assigned/saved, including existing shared terms; omission does not guarantee preservation and can fail or coerce. |
Classification helpers create/find group-term and content-term links, without Plan access rules. Wrong shapes, skipped keys, duplicates or later errors can leave partial replacement.
Create/update response fields
Create returns HTTP 201; update returns HTTP 200. Both return content-with-term-arrays fields at the top level, without items/paginator. That definition covers types, presence and image meanings.
| Returned field/object | Type / presence | Meaning |
|---|---|---|
| Metadata | Fields from the linked definition | id,key,title,description,price,currency,extra,link,created_at,updated_at,published_at. ID/price become integers; display text is entity-decoded. extra has application-defined keys; malformed/null values have no universal conversion. |
| images[] | Array; always present | url,width,height,created_at, without ID/title/hash. Empty if none. Dimension units/conversion and file availability are unspecified. |
| is_payable_content | Boolean; present | Stored price exceeds zero, not a reader-access decision. |
| is_applied_vat, vat_percent | Stored flag/numeric value, potentially null | Configuration, not a tax calculation. |
| content_type | Related key; conditional | Omitted if no related key is defined; not necessarily null. |
| taxonomies[] | Array; always present | Groups with key,title,terms[]; terms with key,title. No numeric classification/link IDs or Plan rules. |
Arrays show current links, rather than key-indexed maps or historical snapshots. Related records can belong to other publications; order and uniqueness are unspecified, and dangling links can fail the response. resource_id, content_type_id, access_level and protected article body are absent. Metadata does not prove delivery or reader access.