Find readers and inspect their memberships
Find a reader by email, browse your audience or inspect a reader’s memberships. The resource header selects the publication. To decide whether to show a particular article, use the content access guide.
Choose a lookup
| Task | Operation | Allowed credentials |
|---|---|---|
| Find a reader by email from a server integration | GET /api/v1/admin/users/data | Authorized service account; root also permitted |
| Find a reader by email from an Admin integration | POST /api/v1/admin/users/get-by-email | Admin read roles; root also permitted |
| Browse or filter an audience | GET /api/v1/admin/users | Admin read roles or authorized service account; root also permitted |
| Page through a reader’s memberships | GET /api/v1/admin/users/{user_id}/subscriptions/list | Admin read roles or authorized service account; root also permitted |
Start with the email lookup for your credential type. Keep the returned reader id for later calls. Use the audience list to browse several readers. An audience text filter is not an exact email lookup.
Credentials and examples
Use the credentials and publication public key supplied by your integration operator. Keep privileged credentials in trusted server code.
| Input | Location / type | Use |
|---|---|---|
resource | Required header, public-key string | Selects the publication for every call. It is not the publication secret or a numeric resource ID. |
token | Header, existing authorized session-token string | Use for the permitted Admin/root context. ADMIN_TOKEN in examples is that existing token. |
service-api-key | Header, existing service-account key string | Use only for the three operations marked service-account eligible above, together with resource. Requires an active, non-suspended account, an active attached user and permission for the specific action. |
Admin read roles are readonly, manager, support, admin and partner. Choose one credential type from the table. A service account’s full_access covers only service-account-eligible routes; it does not enable POST email lookup. The caller must be active; their current publication relationship, when present, must not be locked or suspended.
Examples use fictional IDs and illustrative response excerpts. Requests use cURL, Node.js 18+ fetch in an ES module (.mjs), and Python 3 urllib. Set the environment variables from your existing configuration; WALLKIT_API_BASE is the scheme and host, without /api/v1.
Find a reader by email from a server integration
GET /api/v1/admin/users/data
Find a reader’s ID and membership summary by email within the selected publication. Use this route with an authorized service account or root context.
Before you call
Use the service account described above, or root. An ordinary Admin token is not eligible. The reader must already have a relationship with this publication.
Request
Send the resource header and the credential for your caller type.
| Name | Location | Type / requirement | Meaning |
|---|---|---|---|
email | Query | Valid email string; required for a useful lookup | Trimmed and converted to lowercase before an exact email lookup within the publication. Email filtering also applies. |
No body is needed. Results can be cached for 60 seconds, so a recent change may not appear yet.
Response
HTTP 200 returns the reader and subscriptions at the top level, without a user or data wrapper. See returned objects for the fields.
Example
curl -X GET "${WALLKIT_API_BASE}/api/v1/admin/users/data" \
--get \
-H "resource: ${RESOURCE_KEY}" \
-H "service-api-key: ${SERVICE_API_KEY}" \
--data-urlencode email=reader@example.com
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/data`);
url.search = new URLSearchParams({"email": "reader@example.com"}).toString();
const response = await fetch(url, {
method: "GET",
headers: {"resource": process.env.RESOURCE_KEY, "service-api-key": process.env.SERVICE_API_KEY}
});
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/data"
url += "?" + urlencode({'email': 'reader@example.com'})
headers = {"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]}
request = Request(url, headers=headers, 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 response excerpt:
{
"id": 1001,
"email": "reader@example.com",
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"autorenew": true,
"subscription_end_date": "2026-12-01 00:00:00"
}
]
}
Keep reader ID 1001 for the membership list. Subscription ID 2001 identifies the catalog choice, not the reader or membership relationship.
If the reader is not found
A missing reader, missing publication relationship or unresolved attached user returns HTTP 409. Synthetic error excerpt:
{
"error": "user_not_found",
"error_description": "User not found"
}
Confirm the email and publication with your operator. This lookup does not create accounts.
Recovery
Use shared recovery for context failures, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 409 | invalid_email | Email validation failed. | Send a valid email string. |
| 409 | user_not_found | No matching publication relationship or attached user. | Confirm email and publication; handle a missing reader separately. |
| 409 | resource_required | The local resource check fails; shared guards normally reject it earlier. | Check the resource public key. |
| 409 | incorrect_data | This lookup can return the description Body must be json format even though it uses query parameters. | Keep req_guid and ask the operator to inspect the lookup; adding a GET body is not the fix. |
Next task
Use the returned reader ID to inspect memberships, with the same publication context.
Find a reader by email from an Admin integration
POST /api/v1/admin/users/get-by-email
Find an existing reader’s ID and membership summary using an Admin credential. Although this route uses POST, it only looks up the reader.
Before you call
Use a readonly-or-inherited Admin token, or root, with the publication public key. Service-account keys are not eligible. The reader must already have a relationship with this publication.
Request
Send the resource and token headers.
| Name | Location | Type / requirement | Meaning |
|---|---|---|---|
email | JSON body | Required valid email string | Validated with trimming, then email-filtered for exact stored-email matching. This path does not explicitly lowercase the lookup value. |
Send a JSON object containing email with Content-Type: application/json. Use the stored email spelling: this route does not explicitly lowercase the lookup value. Missing or invalid bodies are described under Recovery.
Response
HTTP 200 returns reader fields and subscriptions at the top level. It adds no teams, tags, last_action or session token. See returned objects.
Example
curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/users/get-by-email" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data-raw '{"email": "reader@example.com"}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/get-by-email`);
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({"email": "reader@example.com"})
});
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/get-by-email"
headers = {"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"}
body = json.dumps({'email': 'reader@example.com'}).encode("utf-8")
request = Request(url, headers=headers, method="POST", data=body)
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 excerpt:
{
"id": 1001,
"email": "reader@example.com",
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"autorenew": true,
"subscription_end_date": "2026-12-01 00:00:00"
}
]
}
Keep reader ID 1001 for later calls. The subscriptions describe existing memberships.
If the reader is not found
A missing reader and a reader without this publication relationship both return HTTP 404. Synthetic excerpt:
{
"error": "user_not_exists",
"error_description": "User not found"
}
Check the email spelling and selected publication. The account may exist elsewhere.
Recovery
Use shared recovery for context failures, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 406 | incorrect_data | Missing JSON or a value treated as empty by the API. | Send a JSON object containing email with the correct Content-Type. |
| 409 | invalid_email | Missing/invalid email fails validation. | Correct email before repeating the lookup. |
| 404 | user_not_exists | No exact email with a selected-publication relationship. | Confirm stored email spelling and publication context. |
Next task
Keep id for the membership list.
Browse a publication’s audience
GET /api/v1/admin/users
Browse a filtered, paginated audience list. Every selected reader has a relationship with this publication, including readers whose relationship is inactive or locked.
Before you call
Use an eligible Admin/root credential or authorized service account. The example uses a service account. Send an explicit page and limit; see collection inputs for filters and sorting.
Request
Send resource and the credential for your caller type.
| Name | Location | Type / requirement | Meaning |
|---|---|---|---|
filter[users.email] | Query | Optional text string | Case-insensitive substring filter in this example; not an exact identity lookup. |
page, limit, order, by, sort, filter | Query | Optional | See collection inputs. |
download | Query | Optional boolean; omitted by discovery examples | True changes this GET into an export request; see the caveat below. |
email | Query | Optional email string; export branch only | Destination passed to export processing, not the audience email filter. |
No body is needed. Export changes the behavior: download=true selects all matching readers, checks separate download permission, and can queue an export task and emit an event. The response uses success: true for a new task or success: false for a matching recent unfinished task, rather than items and paginator. It is not a CSV file or delivery receipt. Service accounts cannot download, including those with full_access. The example omits download and export email. Check an uncertain export result before repeating it.
Response
HTTP 200 returns items containing readers with subscriptions and teams, plus paginator. Counts refer to readers. See returned objects for partner-scoped teams and other fields.
Example
curl -X GET "${WALLKIT_API_BASE}/api/v1/admin/users" \
--get \
-H "resource: ${RESOURCE_KEY}" \
-H "service-api-key: ${SERVICE_API_KEY}" \
--data-urlencode 'filter[users.email]=reader@example.com' \
--data-urlencode page=1 \
--data-urlencode limit=10 \
--data-urlencode order=Users.id \
--data-urlencode sort=ASC
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users`);
url.search = new URLSearchParams({"filter[users.email]": "reader@example.com", "page": "1", "limit": "10", "order": "Users.id", "sort": "ASC"}).toString();
const response = await fetch(url, {
method: "GET",
headers: {"resource": process.env.RESOURCE_KEY, "service-api-key": process.env.SERVICE_API_KEY}
});
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"
url += "?" + urlencode({'filter[users.email]': 'reader@example.com', 'page': '1', 'limit': '10', 'order': 'Users.id', 'sort': 'ASC'})
headers = {"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]}
request = Request(url, headers=headers, 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 response excerpt:
{
"items": [
{
"id": 1001,
"email": "reader@example.com",
"subscriptions": [
{
"id": 2001,
"title": "Monthly"
}
],
"teams": []
}
],
"paginator": {
"current_page": 1,
"page": 1,
"total_pages": 1,
"total_items": 1,
"limit": 10
}
}
This selection returned one reader. An email substring can match several readers; check each identity before choosing one.
If no readers match
HTTP 200 returns an empty items array with pagination. Synthetic excerpt:
{
"items": []
}
Check the page and filter. Use an exact email lookup before concluding that a particular reader is missing.
Recovery
Use shared recovery for context failures, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 406 | incorrect_filter_date / incorrect_filter | A reported filter-validation error. Some invalid filters may instead be ignored. | Correct known filter fields/values; a successful request alone does not validate every filter. |
| 403 | access with download action | The export branch lacks separate download permission. | Use ordinary listing without download, or ask an authorized operator about export. |
| 409 | invalid_email | Export destination email fails validation. | Correct the export email; this is separate from filter[users.email]. |
Next task
Use a returned ID for memberships, with an eligible Admin context or authorized service account.
Page through a reader’s memberships
GET /api/v1/admin/users/{user_id}/subscriptions/list
Read a paginated membership list for a reader and the selected publication’s Plans. Use this when the reader summary is not enough.
Before you call
Use the reader ID from your intended audience records and an eligible Admin/root credential or authorized service account. The example uses a service account. The list selects memberships through Plans in the selected publication.
Request
Send resource and the credential for your caller type. See collection inputs for pagination and filters.
| Name | Location | Type / requirement | Meaning |
|---|---|---|---|
user_id | Path | Required digits-only reader ID | Selects memberships by reader ID. |
page, limit, order, by, sort, filter | Query | Optional | See collection inputs; membership filters use UserPlanRelationships, Subscriptions or Plans. |
No body is needed. The list includes memberships linked to subscriptions and Plans in this publication, including inactive or expired memberships. Read dates and flags for display; check content access separately.
Response
HTTP 200 normally returns items of identity membership objects and paginator. Each item combines catalog fields with membership dates, flags and a nullable sponsored slot. items[].id is the catalog subscription ID; no membership relationship ID is added. Counts include matching rows before invalid mappings are skipped. If all rows are skipped, items can be absent. A caught failure returns items: [], with or without paginator.
Example
curl -X GET "${WALLKIT_API_BASE}/api/v1/admin/users/1001/subscriptions/list" \
--get \
-H "resource: ${RESOURCE_KEY}" \
-H "service-api-key: ${SERVICE_API_KEY}" \
--data-urlencode page=1 \
--data-urlencode limit=10 \
--data-urlencode order=UserPlanRelationships.id \
--data-urlencode sort=ASC
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1001/subscriptions/list`);
url.search = new URLSearchParams({"page": "1", "limit": "10", "order": "UserPlanRelationships.id", "sort": "ASC"}).toString();
const response = await fetch(url, {
method: "GET",
headers: {"resource": process.env.RESOURCE_KEY, "service-api-key": process.env.SERVICE_API_KEY}
});
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/1001/subscriptions/list"
url += "?" + urlencode({'page': '1', 'limit': '10', 'order': 'UserPlanRelationships.id', 'sort': 'ASC'})
headers = {"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]}
request = Request(url, headers=headers, 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 response excerpt:
{
"items": [
{
"id": 2001,
"title": "Monthly",
"plan": {
"id": 3001,
"title": "Subscriber"
},
"subscription_start_date": "2026-10-01 00:00:00",
"subscription_end_date": "2026-12-01 00:00:00",
"autorenew": true,
"subscription_is_external": false,
"sponsored_subscription_slot": null
}
],
"paginator": {
"current_page": 1,
"page": 1,
"total_pages": 1,
"total_items": 1,
"limit": 10
}
}
Reader 1001 has subscription 2001 under Plan 3001. The end date and autorenew choice describe that membership.
If the list is empty
An empty selection or another caught failure returns HTTP 200 with an empty array. Synthetic excerpt:
{
"items": []
}
An empty response can mean no memberships or a query, filter or mapping failure. If memberships were expected, keep the reader, publication, page and filters for your operator to investigate. Do not delete or downgrade local records based on this result alone. Also handle an absent items field when every selected row was skipped.
Recovery
Use shared recovery for context failures, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 200 | items: [], optional paginator | No result or a caught failure; not an error envelope. | Check known reader/context and filters; ask the operator to investigate unexpected emptiness. |
| 200 | Some mapped rows missing, or items absent | Invalid relationships can be skipped after pagination. | Do not equate raw total_items with returned item count or infer all memberships were absent. |
Next task
Use a content-access check before serving protected content. To find another reader, return to choose a lookup.
Read the returned objects
The top-level id identifies the reader. Inside subscriptions, id identifies a catalog subscription, not the membership relationship. None of these lookups returns a new authentication token.
| Returned object | Fields and meaning |
|---|---|
| Reader | Fields from User, with publication-specific values for extra, uid, user_resource_created_at, language, locked, active, confirm and conditional settings/role. See Resource-aware user for these fields. Additional objects follow the endpoint table below, rather than the sign-in response. |
| Activity | last_activity_date uses this publication’s sessions and can be null. online indicates activity, not reliable live presence. |
subscriptions[], or membership-list items[] | Fields from Identity membership: the catalog subscription, compact Plan, next/downgrade choices, membership dates/flags and a nullable sponsored slot with sponsorship/sponsor details. The linked definition lists the fields in each nested object. subscription_end_date can be null. Membership autorenew differs from catalog is_allowed_autorenew. Parent-membership values are not a guaranteed fallback. |
teams[] | Fields from Identity team: active teams attached to the reader within the publication’s partner scope. This can include teams from other publications. |
paginator | Pagination fields: current_page, page, total_pages, total_items, limit. Counts include selected records before memberships with invalid relationships are skipped. |
| Endpoint | Fields returned by each endpoint |
|---|---|
| GET email / POST email | Reader fields plus subscriptions; no teams, tags or last_action. |
| Audience list | Reader fields plus subscriptions and teams in each item; no tags or last_action. |
| Membership list | Memberships inside items, with pagination when available; no enclosing reader profile. |
settings and role require an authorized Admin context and may be absent from service-account responses. extra and settings use your publication’s own keys. Memberships with missing or incompatible relationships may be skipped; returned memberships can be inactive or expired. Check content access separately. Date and money formats follow the linked definitions.
Collection inputs
These query inputs apply to audience and membership lists, not single-reader lookups.
| Name | Type / requirement | Meaning |
|---|---|---|
page | Optional integer | Send a positive page, such as 1; an omitted-page default is unspecified. |
limit | Optional integer; fallback 10 | Send a positive page size, such as 10. This reference does not specify a maximum. |
order, by | Optional field string | order takes precedence over by. Default: creation time on Users for the audience list and UserPlanRelationships for memberships. Use a known field. |
sort | Optional direction string; default DESC | Use ASC or DESC. Equal values have no guaranteed tie order. |
filter | Optional bracket query map or JSON-encoded object | Prefix fields with their model name. Matching depends on field type, as described below. Omission adds no filter. Unknown or invalid filters may be ignored even when the request succeeds. |
For the audience list, filter[users.email]=reader@example.com matches an email substring, ignoring case. Use an email lookup for an exact match. filter[Users.id]=1001 selects a reader ID. Other available filters depend on model metadata and joins across reader/publication relationships, subscriptions, Plans, memberships, teams, purchases, history, content, tags, promotions, sessions, invitations and event tickets. Some related team and activity rows extend beyond the selected publication. Use documented fields rather than assuming any field can be filtered.
Membership filters use UserPlanRelationships, Subscriptions and Plans; for example, filter[UserPlanRelationships.subscription_id]=2001. Text matches ignore case and use substrings. Numeric arrays or comma-separated values select IDs; boolean fields use true/false conversion. Omission leaves a filter unrestricted; null, empty and false differ. See filter conventions. Lists can change between requests, and some selected records may be skipped when converted to response objects.
Shared recovery
Errors normally include error, error_description and req_guid. Keep req_guid when asking your integration operator for help. These shared failures can occur before the operation-specific work.
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 401 / 403 | access | Missing permitted role/action or account grant; established non-guest callers normally receive 403. | Check the operation’s caller column and ask the operator to confirm that exact permission. A service account cannot substitute for Admin context on every route. |
| 401 | auth_failed | Required caller identity did not resolve. | Check the existing credential and chosen header with your operator. |
| 401 | auth_access_fail | Caller inactive, or current relationship locked/suspended. | Ask the operator to inspect activation and relationship restrictions. |
| 401 | token_expired / token_compromised | An applicable session check rejects the credential. | Use an existing current authorized credential; do not repeat the lookup with the same rejected token. |
| 404 | resource_not_exists | Public resource key does not resolve. | Confirm the publication public key; changing the reader ID does not repair it. |
| 409 | initialize_failed | Context initialization failed. | Supply req_guid and the selected publication context to the operator. |