Inspect reader content records and manage direct grants
List a reader’s directly linked articles, inspect recorded access, or add and remove direct grants. Use the content access guide for a current allow/deny decision.
| Task | Operation | Allowed credentials |
|---|---|---|
| List content with stored direct relationships | GET /api/v1/admin/users/{user_id}/content | readonly, manager, support, admin or partner, or root |
| Inspect recorded access rows | GET /api/v1/admin/users/{user_id}/access-content | readonly, manager, support, admin or partner, or root |
| Add a direct content relationship | POST /api/v1/admin/users/{user_id}/content/{content_key} | support, admin or partner, or root |
| Remove a direct content relationship | DELETE /api/v1/admin/users/{user_id}/content/{content_key} | support, admin or partner, or root |
Use the direct list to inspect stored grants and recorded access to review past decisions. After a grant change, inspect the stored result and check access in the reader’s own context before serving protected content.
Credentials, reader and content context
Send the assigned token and publication public-key resource headers. Allowed roles are listed above. Service accounts cannot use these routes, including those with full_access.
| Input | Location / type | Meaning |
|---|---|---|
resource | Required header, public-key string | Selects the publication. It is not a secret or a numeric resource ID. |
token | Required header, existing authorized token string | ADMIN_TOKEN in examples is this credential, not the target reader’s ordinary token. |
user_id | Required digits-only path value | Known reader’s global account ID. Not a session ID or content ID. |
content_key | Required path string on mutations | Existing content key within the selected publication. Encode it as one URL path segment and preserve its exact value; it is not the numeric content record ID. |
Choose the intended reader from your audience records and content from the selected publication. Stored content relationships and access rows use that publication. The caller must be active; their current publication relationship, when present, must not be locked or suspended.
Examples and pagination
Examples use fictional reader 1002, content key article-1001, content ID 5001 and session 6001. 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 existing RESOURCE_KEY and ADMIN_TOKEN. Keep privileged calls in trusted server code.
Both lists accept optional integer page and limit. Send a positive page, such as 1; an omitted-page default is unspecified. Limit defaults to 10; send a positive size, such as 10. This reference does not specify a maximum. The common paginator has current_page, page, total_pages, total_items and limit. Empty pages return items: []. Cached or replica results may lag.
List directly linked content
GET /api/v1/admin/users/{user_id}/content
List content directly linked to this reader in the selected publication. Subscription, bundle and other access paths are outside this list. It is not view history.
Before you call
Use an eligible token, publication key and the intended reader ID. The reader account must exist. This list shows stored links, rather than evaluating current access.
Request
No body is needed. Send the common path, headers and pagination, plus:
| Query input | Type / requirement | Meaning and constraints |
|---|---|---|
filter | Optional bracket query map | Fields from Users and Content, depending on configured field metadata. For example filter[Content.title] is case-insensitive substring matching. Unknown keys can be ignored; filter failures do not all have a uniform error response. |
by | Optional field string; default Content.id | Sort field. Use a known field; arbitrary field names are not a promised sorting interface. |
sort | Optional direction string; default DESC | Use ASC or DESC. No stable tie ordering is guaranteed. |
Use bracket query filters, such as filter[Content.title]=example. JSON-encoded filters and numeric-range shorthand are not supported here. The example sorts by Content.id ascending; that does not add numeric IDs to the response.
Response
HTTP 200 returns items and paginator. Each item has the base content fields: key, title, description, price, currency, extra, link, created_at, updated_at, published_at, images and is_payable_content. Numeric content ID, taxonomies, VAT, content type and grant ID/dates are absent.
Titles and descriptions are entity-decoded. extra contains content-defined decoded values; images can be empty. Price units and timestamp timezone are unspecified. is_payable_content means the stored price is positive, not that the reader paid or currently has access.
Example: List reader 1002’s direct relationships
curl -X GET "${WALLKIT_API_BASE}/api/v1/admin/users/1002/content" \
--get \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
--data-urlencode page=1 \
--data-urlencode limit=10 \
--data-urlencode by=Content.id \
--data-urlencode sort=ASC
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002/content`);
url.search = new URLSearchParams({"page": "1", "limit": "10", "by": "Content.id", "sort": "ASC"}).toString();
const response = await fetch(url, {
method: "GET",
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
from urllib.parse import urlencode
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/users/1002/content"
url += "?" + urlencode({'page': '1', 'limit': '10', 'by': 'Content.id', 'sort': 'ASC'})
request = Request(url, headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]}, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 result:
{
"items": [
{
"key": "article-1001",
"title": "An example article",
"description": "An illustrative article.",
"price": 500,
"currency": "USD",
"extra": {},
"link": "https://example.com/articles/article-1001",
"created_at": "2026-10-01 12:00:00",
"updated_at": "2026-10-01 12:00:00",
"published_at": "2026-10-01 12:00:00",
"images": [],
"is_payable_content": true
}
],
"paginator": {
"current_page": 1,
"page": 1,
"total_pages": 1,
"total_items": 1,
"limit": 10
}
}
The stored link is for article-1001. Use that key for grant changes. Its positive price does not show a payment.
No direct content on this page
HTTP 200 excerpt:
{"items":[]}
Check the page, filter and paginator. Other access paths may still allow content even when this direct list is empty.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | user_not_exists | Global reader ID does not resolve. | Confirm the intended audience ID. |
| Not uniformly specified | Filter/query/mapping failure | These failures do not all have a normalized action-specific response. | Use known bracket-filter fields, explicit pagination and supported sort values; retain request context for the operator. |
| 200 | items:[] | No direct relationships selected on this page. | Check selection and current access separately; do not infer a global denial. |
Next task
Read recorded access for past decisions, or add a direct grant. Check current access separately.
Inspect recorded content access
GET /api/v1/admin/users/{user_id}/access-content
Read stored access rows for this reader and publication. These describe past decisions, not current permission or every attempted view. Current access checks record successful accesses; the list can also include other stored access values.
Before you call
Use an eligible token, publication key and the intended reader ID. Rows are selected by reader and publication. This read does not create grants or change history.
Request
No body is needed. Use common pagination, plus:
| Query input | Type / requirement | Meaning and constraints |
|---|---|---|
date_from | Optional YYYY-MM-DD string | Inclusive lower bound on the stored record’s creation date, when parsed. |
date_end | Optional YYYY-MM-DD string | Inclusive upper bound on the stored record’s creation date, when parsed. |
Omit either date bound to leave that side unrestricted. Send valid calendar dates: invalid bounds can be ignored or normalized rather than rejected. Rows use created_at descending order; filter/by/sort inputs are ignored. Timestamp timezone and complete historical coverage are unspecified; replica results may lag.
Response
HTTP 200 returns items and paginator, with an empty array when the page has no matches. Each item has these seven fields:
| Field | Type / presence | Meaning |
|---|---|---|
content_id | Stored numeric reference | Content record ID for the recorded row, not the grant relationship ID. |
access | Stored flag | Recorded outcome value; not freshly evaluated or explicitly converted to one JSON type here. |
reason | Stored nullable text | Recorded reason label, not a closed enum or payment proof. |
session_id | Nullable stored numeric reference | Related session, not a session credential. |
created_at | Timestamp string | Recorded row creation time; not a grant expiration. |
content_title | Text/null | Entity-decoded title from the current content record; null if that relation is unavailable. |
content_key | String/null | Current content key, or null without the related content. |
Items add no access-record ID, reader/publication ID, grant ID, URL or expiry. Content metadata may have changed since access was recorded.
Example: Read October records
curl -X GET "${WALLKIT_API_BASE}/api/v1/admin/users/1002/access-content" \
--get \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
--data-urlencode page=1 \
--data-urlencode limit=10 \
--data-urlencode date_from=2026-10-01 \
--data-urlencode date_end=2026-10-31
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002/access-content`);
url.search = new URLSearchParams({"page": "1", "limit": "10", "date_from": "2026-10-01", "date_end": "2026-10-31"}).toString();
const response = await fetch(url, {
method: "GET",
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
from urllib.parse import urlencode
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/users/1002/access-content"
url += "?" + urlencode({'page': '1', 'limit': '10', 'date_from': '2026-10-01', 'date_end': '2026-10-31'})
request = Request(url, headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]}, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 result:
{
"items": [
{
"content_id": 5001,
"access": true,
"reason": "content",
"session_id": 6001,
"created_at": "2026-10-30 12:00:00",
"content_title": "An example article",
"content_key": "article-1001"
}
],
"paginator": {
"current_page": 1,
"page": 1,
"total_pages": 1,
"total_items": 1,
"limit": 10
}
}
The row records successful access to content 5001. Its reason describes that decision; it is not proof of payment or current access.
No recorded rows on this page
HTTP 200 excerpt:
{"items":[]}
Check date bounds, page and paginator. No rows does not establish whether the reader attempted access, has grants or is currently allowed.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | user_not_exists | Global account does not resolve. | Confirm reader ID. |
| 409 | user_access_list_error | A caught query/mapping failure. | Retain the request reference and ask the operator to inspect the selection. |
| 200 | Empty/unexpected date selection | No rows selected, or a date bound was ignored/normalized. | Use valid calendar dates and inspect the paginator; absence is not a complete attempt history. |
Next task
Use the content-access guide for a fresh decision in the reader’s context. Use the direct list to manage stored grants.
Add a direct content relationship
POST /api/v1/admin/users/{user_id}/content/{content_key}
Store a direct reader/content relationship. This does not take payment or evaluate current access. There is no expiration field, but the grant still remains subject to account restrictions and access rules.
Before you call
Use a support-or-inherited Admin token, or root, and the publication key. Identify the intended reader from your audience records and an existing content key in this publication.
Request
Put the reader ID and exact content key in the path, without a body. There are no expiration, price, payment or renewal inputs. article-1001 fits one path segment. Encode other keys appropriately.
Response
HTTP 201 returns result: true. A reported failure returns HTTP 409 with result: false, without the normal error-code envelope.
Inspect the stored result before retrying: either a reported success or a failure can leave uncertain grant state. Later event/cache work can fail after a write. Duplicate requests have no reliable status or idempotency contract; check the direct list before repeating a request.
Example: Grant article-1001
curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/users/1002/content/article-1001" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002/content/article-1001`);
const response = await fetch(url, {
method: "POST",
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/users/1002/content/article-1001"
request = Request(url, headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]}, 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 result:
{"result":true}
The response contains no grant ID or expiry. The grant does not record a view or take payment.
Grant reports failure
HTTP 409 result:
{"result":false}
Inspect stored grants before repeating; the write or later event/cache work may have failed. This response does not reliably identify duplicates.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | user_not_exists | Global reader ID missing. | Confirm reader identity. |
| 404 | content_not_exists | Content key does not resolve in the selected publication. | Check exact key and publication; do not replace it with a numeric content ID. |
| 409 | result:false, no ordinary error code | Grant request reported failure, possibly after a write. | Inspect stored relationships and retain request context for the operator before retrying. |
| 406 | content_user_access_exists | Some failures return this code with the description User already have access to this content. | Inspect the relationship; do not depend on this code as a reliable duplicate test. |
| Not uniformly specified | Other lookup/argument failure | Some lookup failures do not use a uniform error response. | Check the existing nonempty key, encoded path and selected publication with the operator. |
Normal processing invalidates the user/publication/content cache, but cached or replica views can still lag. Errors do not guarantee rollback, and events do not prove notification delivery.
Next task
Inspect directly linked content, then use the content-access guide for a current decision.
Remove a direct content relationship
DELETE /api/v1/admin/users/{user_id}/content/{content_key}
Remove the first matching direct reader/content relationship. Recorded access, memberships and reader sessions remain. Other grants or access paths can still allow the article.
Before you call
Use the permitted token, publication key, intended reader ID and exact content key from this publication.
Request
Send the path and headers without a body. There are no history-erasure, expiration or refund options.
Response
HTTP 200 returns result: true when removal processing reports completion. Inspect the stored links if the result is uncertain; this marker does not confirm persistence. Only the first match is selected, so duplicate links may remain.
A missing match or reported failure returns HTTP 409 with result: false, without the normal error envelope. Event failure after deletion can produce the same result; it does not distinguish an absent link from failed or partial removal.
Example: Revoke article-1001’s direct relationship
curl -X DELETE "${WALLKIT_API_BASE}/api/v1/admin/users/1002/content/article-1001" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002/content/article-1001`);
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/users/1002/content/article-1001"
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 result:
{"result":true}
Removal reported completion. Inspect the direct list and check current access.
Nothing removed, or removal reports failure
HTTP 409 result:
{"result":false}
Check stored links before repeating. This result can mean no matching link or failed deletion/event work; it is not an already-revoked success response.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | user_not_exists | No global reader ID. | Confirm the intended reader. |
| 404 | content_not_exists | No content for this key/publication. | Check exact key and resource context. |
| 409 | result:false, no ordinary error code | No match, a failed removal step or event failure after a possible delete. | Inspect relationships and reconcile state with the operator before retrying. |
| Not uniformly specified | Other lookup/argument failure | Some lookup failures are not normalized by this action. | Retain request context; check the key and publication with the operator. |
Cache invalidation targets this user/publication/content lookup. Recorded views remain; cached results can lag, and memberships, prior-access rules or other paths can still allow content.
Next task
Inspect the direct list and use the content-access guide. Recorded access remains historical.
Shared recovery
Ordinary errors include error, error_description and req_guid. The mutation-specific result: false responses do not use that envelope. Check both HTTP status and result.
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 401 / 403 | access | Caller role/action not permitted. | Use the eligible existing Admin context; these actions have no service-account grant. |
| 401 | auth_failed | Required identity did not resolve. | Check credential and custom token header with the operator. |
| 401 | auth_access_fail | Caller inactive or current caller/publication relationship locked/suspended. | Ask the operator to inspect those restrictions. |
| 401 | token_expired / token_compromised | Applicable session check rejected the token. | Use an existing current authorized credential. |
| 404 | resource_not_exists | Publication public key missing/incorrect. | Confirm it; changing the reader ID does not repair publication context. |
| 409 | initialize_failed | Context initialization failed. | Retain request reference and context for the operator. |