Create and update reader accounts

Add a reader to a publication or edit an existing account. Some fields belong to the shared account and affect every publication that uses it.

TaskOperationAllowed credentials
Add a reader, or attach an existing accountPOST /api/v1/admin/userssupport, admin or partner, root, or authorized service account
Update a known readerPUT /api/v1/admin/users/{user_id}support, admin or partner, or root; no service-account access

Create can return HTTP 201 for either a new account or an existing account attached to this publication. Keep the returned id for later calls. Read the existing-email behavior before including optional fields.

Account names, contact details, email and passwords belong to a shared account. Changes can affect the reader across publications. Confirm the intended reader and coordinate shared-account changes with the publications using that account.

Credentials and examples

Use the API address, publication public key and authorized credential supplied by your operator. Keep privileged requests in trusted server code.

HeaderType / requirementPurpose
resourceRequired publication public-key stringSelects the publication relationship. This is not a numeric ID or publication secret.
tokenExisting authorized session-token stringFor support, inherited admin/partner roles, or root. readonly and manager do not have these writes. ADMIN_TOKEN in examples denotes that existing credential.
service-api-keyExisting authorized service-account key string; create onlyAlso requires resource, an active non-suspended account, an active attached user, and permission for the create action. full_access only bypasses individual grants within the service-account role’s eligible actions; it does not enable update.

Choose one supported credential type. The caller must be active; a current caller/publication relationship, when present, must not be locked or suspended. Ordinary reader tokens do not grant these writes.

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 environment variables from existing configuration; WALLKIT_API_BASE is the scheme and host, without /api/v1.

Add a reader to a publication

POST /api/v1/admin/users

Add a reader by email. A new email creates an active global account with role user and attempts to attach it to the publication. An existing global email follows the attachment behavior below.

Before you call

Use the publication key and an eligible credential. The example uses a service account. Send JSON with Content-Type: application/json and a valid email. Lookup filters, trims and lowercases the email. An email already attached here is rejected with invalid_email.

The simple example assumes a new account. If the email already exists, follow the attachment guidance below. Configured Firebase/Firestore integrations can also create, reuse or update external account data before the local request finishes.

Request

NameLocationType / requirementMeaning
emailJSONRequired valid email stringAccount email, normalized for lookup/storage; not a publication-local alias.
first_name, last_nameJSONOptional stringsProfile names used when creating a new global account. Ignored by the existing-account attachment branch.

All other supported inputs are in optional fields. Omit them for a simple account addition. Without a password, the new-account branch creates a password-reset record; without confirmation, it normally creates an email-confirmation record. Account-creation events can initiate the configured reset or confirmation workflow. The response does not establish mail delivery, a completed reset or a signed-in reader.

Response

HTTP 201 returns the reader result at the top level, including subscriptions and teams. There is no user/data wrapper, session token or separate created-versus-attached flag.

Example: Add a new reader

Assume new-reader@example.com has no global account. The example returns reader 1002.

curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/users" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "service-api-key: ${SERVICE_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-raw '{"email": "new-reader@example.com", "first_name": "Sam", "last_name": "Lee"}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users`, {
  method: "POST",
  headers: {"resource": process.env.RESOURCE_KEY, "service-api-key": process.env.SERVICE_API_KEY, "Content-Type": "application/json"},
  body: JSON.stringify({"email": "new-reader@example.com", "first_name": "Sam", "last_name": "Lee"})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

body = {'email': 'new-reader@example.com', 'first_name': 'Sam', 'last_name': 'Lee'}
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/users",
    data=json.dumps(body).encode("utf-8"),
    headers={"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"], "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 excerpt:

{"id":1002,"email":"new-reader@example.com","first_name":"Sam","last_name":"Lee","subscriptions":[],"teams":[]}

Keep reader ID 1002 for later calls. The excerpt shows no memberships or teams.

Consequential alternate: The email already exists elsewhere

If the email already has a global account but no relationship with this publication, create attempts to attach that account and still returns HTTP 201. Submitted profile names are ignored. The same request could return:

{"id":1001,"email":"new-reader@example.com","first_name":"Alex","last_name":"Lee","subscriptions":[],"teams":[]}

Here the existing account is 1001, and its name Alex is preserved. Use update for profile changes; repeating create does not update them.

For an existing account, attachment uses existing account and relationship configuration. The resulting role, credentials and confirmation state can differ from a newly created reader’s defaults. Do not rely on submitted optional values being applied; review the resulting state and use the appropriate authorized update workflow. A role field does not select the resulting role.

Existing-account attachment does not reliably apply the submitted language_id. Most profile fields and optional subscription, team, content and customer actions are skipped, as are locked and settings. Submitted password, confirmation and extra values may also be unused. This branch does not create the new-account confirmation/reset records or emit the same account-creation/synchronization events. Review the returned account and use separate tasks for any remaining changes. Configured external account work may already have occurred.

Recovery

Use shared recovery, plus these create outcomes:

HTTP statusAPI code / shapeCauseNext action
409invalid_emailInvalid/missing email, or email already related to this publication.Correct the address; if the intended reader already belongs here, find their existing ID and use update rather than repeat create.
409invalid_{field}A supplied optional field fails its validator; see the field table. Nickname length errors can use invalid_User.Correct the named value; do not assume every validation code uses the JSON key spelling.
400error contains external-service exception text; description can be nullConfigured Firebase/Firestore account work failed.Retain the request reference and ask the integration operator to inspect local and external state before retrying. Provider error codes can vary.
412payment_error, payment_customer_error, subscription_error, team_error, create_user_failA caught write or follow-on action failed.Confirm current account, relationship and optional/provider results before repeating; failure does not prove all earlier effects were reversed.
201Existing account returned; optional/profile changes absentExisting-email attachment branch ran, or an optional save was not established by the response.Inspect the returned ID/profile and intended membership state. Use the appropriate separate reader task instead of blindly repeating create.

A failed or successful response may leave only some requested changes applied. External account changes and emitted events may remain after a local failure, and follow-on work can fail after a commit. Inspect the current account, publication relationship and external state before retrying.

Next task

Use the returned ID for a profile update, or to inspect memberships. Check content access before serving protected content.

Update a known reader

PUT /api/v1/admin/users/{user_id}

Change profile or publication-relationship fields. Omitted fields usually stay unchanged, subject to the rules below. Names, contact details, email and password belong to the global account.

Before you call

Use a support-or-inherited Admin token, or root, and the publication public key. Service accounts cannot update. Use the numeric reader ID from the intended audience record.

Confirm the reader against your existing audience records before updating. Shared-account fields affect other publications using that account. An update can also attach a publication relationship; review both the shared profile and the selected-publication result.

Request

Send a JSON object with Content-Type: application/json.

NameLocationType / requirementMeaning
user_idPathRequired digits-only reader IDSelects the global account.
first_nameJSONOptional stringReplaces the global first name after string filtering/trimming; omitted/null preserves it.

The example changes only the first name. Read optional fields before adding credentials, relationship state, team or provider fields. Omission, null, empty strings and false differ. Even this small update can create a missing publication relationship.

Response

HTTP 200 returns the reader result with subscriptions and teams. A reset request can add boolean reset_password: the reset-record save result, not a token or proof of delivery or completion.

Example: Change a reader’s name

Change reader 1002 from Sam to River. This edits the global profile; the response uses the selected publication’s relationship fields.

curl -X PUT "${WALLKIT_API_BASE}/api/v1/admin/users/1002" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${ADMIN_TOKEN}" \
  -H "Content-Type: application/json" \
  --data-raw '{"first_name": "River"}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002`, {
  method: "PUT",
  headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
  body: JSON.stringify({"first_name": "River"})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

body = {'first_name': 'River'}
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/users/1002",
    data=json.dumps(body).encode("utf-8"),
    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 excerpt:

{"id":1002,"email":"new-reader@example.com","first_name":"River","last_name":"Lee","subscriptions":[],"teams":[]}

The returned first name is River. The name change applies to the shared account.

If a password-reset request is refused

An update that includes reset_password: true can return HTTP 409 when the current publication relationship is locked or suspended. Synthetic error excerpt:

{"error":"user_locked","error_description":"Unable to reset password to locked user."}

Other requested profile, relationship or external changes may already have taken effect when the reset is refused. Inspect current state before retrying. user_suspended has the corresponding suspended-relationship outcome.

Recovery

Use shared recovery, plus:

HTTP statusAPI code / shapeCauseNext action
404user_not_existsNo global account with that numeric ID.Confirm the reader ID from the intended audience records.
409invalid_emailInvalid supplied email or a different email already in global use.Confirm the intended account address and correct input; do not treat email as publication-local.
409invalid_{field}, possibly invalid_User for nicknameSupplied field validation failed.Correct the field using the constraints below.
409user_locked / user_suspendedCurrent publication relationship blocks the reset request after earlier work.Ask the operator to reconcile attempted changes; do not assume a complete rollback or blindly repeat the combined update.
412payment_error, payment_customer_error, subscription_error, team_error, create_user_failA caught update/follow-on failure. The generic code still says create_user_fail.Retain the request reference and check global, relationship and provider state before retrying.

Inspect the resulting account and any optional or external changes after an uncertain result. A response does not confirm that every requested change or notification completed, and later failures may leave saved changes in place.

Next task

For another account lookup, use the Admin email lookup with the reader’s stored email and selected publication. Read memberships separately.

Optional fields

Both calls use JSON. The create column describes a new global account unless stated otherwise; attachment skips many fields. Update generally preserves omitted values. A newly attached relationship starts with its defaults. Unknown fields do not make other account properties writable.

FieldType / requirementCreate behaviorUpdate behavior and practical limits
emailRequired valid string on create; optional on updateNormalized for global account lookup; already-related email rejected.Nonempty value updates global email. Null/empty does not clear it; a non-null supplied email can still trigger configured external account work. Duplicate comparison and final storage do not use identical normalization steps.
nick_nameOptional string; filtered nickname length 3–64Requested nickname is validated, but the stored value is derived from first_name; do not rely on the requested nickname being saved.Supplied property, including null, enters nickname filtering/validation. Uniqueness is checked against other accounts. Use a concrete valid string, not null to clear.
first_name, last_nameOptional stringsGlobal reader names.Global profile changes; null/omitted preserves, empty strings can replace text.
country, city, state, address, company, job, phoneOptional stringsGlobal profile/contact fields.Same global fields; string-filtered and trimmed. Null/omitted preserves; empty text can be written.
zipOptional string, max 20 characters when validatedLength checked when nonempty.Length checked when non-null supplied. This is not a postal-format check.
ipOptional string, max 15 characters when nonemptyRecorded global IP value.Updates recorded global IP. The length check is not an IP-format validator or a general IPv6 contract.
allow_printingOptional boolean inputSets global printing flag.Changes global flag, not article-access entitlement.
passwordOptional nonempty stringHashes for the new global account and publication relationship. If omitted, creates a reset record. Existing-account attachment may not apply the supplied password; use the authorized account-update or password-reset workflow for password changes.A nonempty value changes global and publication credentials; null/empty preserves them. This alone does not guarantee session revocation or update of a configured external identity password: that external password path also requires a supplied email. External identity receives the supplied password, while local processing trims/string-filters it.
confirmOptional boolean inputSets new global and relationship confirmation; absent relationship value defaults false. Confirmation-record creation uses the raw input’s presence/truthiness, so prefer JSON booleans. Existing attachment may not apply this value; review the resulting confirmation state.Sets current relationship confirmation, not global confirmation directly. It is an administrative state change, not evidence the reader completed verification.
extraOptional JSON objectPublication-reader extra properties; existing attachment may ignore submitted extra. extra.firestore can also be sent to a configured external store.Merges supplied extra properties; not a general erase operation. External-store update requires an attached external ID and the relevant extra payload. No fixed extra schema.
language_idOptional nonzero integerSets relationship language for a new account. Existing-account attachment does not reliably use the supplied language ID.Sets relationship language; omission/null/zero preserves it. Choose an existing configured language. This input does not provide a clear-to-null operation.
settingsOptional object-like valueCast to object for the new publication relationship; ignored by existing-email attachment.Replaces relationship settings when non-null supplied; not global user settings or publication configuration. No closed property schema.
lockedOptional boolean inputSets new relationship lock flag; ignored by existing-email attachment.Changes current relationship lock. A change to locked attempts to deactivate active sessions for this user/publication and emits a lock event. Unlock does not reactivate sessions.
activeOptional boolean input; update onlyCreate input ignored; a new global account is active. Attachment does not reactivate an existing global account.Changes the current relationship’s suspended flag to the inverse of active. It does not change global activation or perform the session-deactivation action described for locked.
subscription_idOptional existing subscription ID or collection of IDs; create onlyAttempts memberships for nonzero IDs; existing attachment skips them.Ignored by update. Choose existing subscription IDs from the intended publication’s catalog. Membership processing follows the subscription’s Plan; confirm the intended IDs with the operator. No charge or checkout guarantee.
team_idOptional existing numeric team IDChecks team existence/capacity and applicable activity condition, then attaches the new reader. May add the team subscription when explicit subscription_id is absent. Existing attachment skips this.Attaches to a found team and may add its subscription; missing team can be ignored. Choose a team from the intended publication/customer context. Attachment makes the team relationship active with role user. Team never_lock settings can also change shared reader settings; coordinate this with the publications using the account.
content_keyOptional content key or collection; create onlyValidates selected-publication content and attempts grants in the new-account branch. Collection values are processed; do not assume every scalar/collection form behaves identically. Existing attachment skips this.Ignored by update. Optional content-grant failure need not turn the whole result into an error.
customer_idOptional existing provider-customer identifier stringSupplied non-null value triggers customer retrieval and local customer/card association for a new account; attachment skips it.Nonempty value triggers provider retrieval and local association. This is not a payment charge or a guaranteed independent provider transaction.
pay_systemOptional string; when nonempty, stripe or braintreeChooses customer-association payment system when applicable.Same validation; no default or required pairing is asserted here.
reset_passwordOptional boolean input; update onlyNot consumed as a create input; missing password has the separate automatic reset-record effect above.True requests a reset record unless current relationship locked/suspended. The response may add a save-result boolean; notification/event processing does not prove delivery.
role, token, refresh_tokenNot writable through these JSON inputsNew global role is user. Existing-account attachment follows existing configuration; sending role does not select the result.No direct role assignment or session-token issuance through these fields. For update, an existing relationship keeps its role and a newly attached relationship defaults to user. Confirm the intended reader before calling.

Use JSON booleans. Omission, null, false and empty text have different effects. Membership, team, customer and external-identity helpers can add writes and events; inspect their state after an uncertain result.

Reader result

Both calls return these fields; update can also acknowledge a reset request:

Returned field/objectType / presenceMeaning
Reader fieldsTop-level fieldsFields from User, with publication-specific extra, uid, user_resource_created_at, language, locked, active and confirm from Resource-aware user. Use this table for additional objects, rather than the sign-in response. id identifies the reader.
settings, roleDynamic value/null for settings; string for role; conditionalCurrent publication relationship settings and resolved role. Returned for an authorized Admin context; not required in every service-account response.
subscriptionsArrayFields from Identity membership: catalog subscription, Plan, membership dates/flags and nullable sponsored slot with sponsorship/sponsor details. Empty or skipped records are possible; inactive or expired memberships can be returned. Subscription id is not the relationship ID.
teamsArrayFields from Identity team: active teams attached to this reader within the publication’s partner scope. This can include other publications’ teams.
reset_passwordBoolean; update reset branch onlyReset-record save result, not a token or delivery/completion confirmation.

The response adds no tags, last_action or new session/refresh token. last_activity_date uses this publication’s sessions; online indicates activity. Passwords, hashes and reset/confirmation secrets are not returned. extra and settings have publication-defined keys. Date and money formats follow the linked definitions.

Shared recovery

Errors normally include error, error_description and req_guid. Keep the request reference for your operator, especially after an uncertain write.

HTTP statusAPI code / shapeCauseNext action
401 / 403accessRequired caller role or specific account action grant missing.Check create versus update eligibility. A service key cannot be used for update.
401auth_failedRequired caller identity did not resolve.Confirm the existing credential and transport header with the operator.
401auth_access_failCaller inactive, or current caller relationship locked/suspended.Ask the operator to check those restrictions.
401token_expired / token_compromisedApplicable session check rejects the credential.Use an existing current authorized credential; do not repeat with the same rejected token.
404resource_not_existsPublication public key does not resolve.Confirm the key; changing the reader ID does not repair it.
409initialize_failedContext initialization failed.Supply req_guid and publication context to the operator.
406incorrect_dataMissing JSON or a value treated as empty by the API.Send a JSON object and Content-Type: application/json.

Full diagram

Use the arrow keys to scroll. Escape closes this view.

Search documentation

Enter at least 2 characters.

    ↑ ↓ move through results · Enter opens · Escape closes