Attach and remove team members

Add existing accounts to a team or remove their team relationships. The resource header selects caller context; attachment and removal use different visibility rules below.

TaskOperation
Attach a reviewed list of accountsPOST /api/v1/admin/teams/{id}/users
Remove one team relationshipDELETE /api/v1/admin/teams/{id}/users/{user_id}
Attach/reactivate one account with PUTPUT /api/v1/admin/teams/{id}/users/{user_id}
Attach/reactivate one account with POSTPOST /api/v1/admin/teams/{id}/users/{user_id}

Single-member PUT and POST do the same job. Either can create or reactivate a link and set its team role to user. Reattachment can replace an owner/admin team role. It does not preserve that role or change the account’s global role.

Existing credentials, IDs and visibility

Allowed credentials: a token for support, admin or partner; root; or an eligible service key. readonly/manager alone cannot write. Service accounts must be active, non-suspended, attached to an active user and permitted for this action; full_access covers only eligible service-account actions.

InputLocation / typeMeaning
resourceRequired header, publication public-key stringSelects request context. Not a numeric resource/partner ID or secret.
tokenHeader, existing authorized token stringUse for permitted Admin/root context.
service-api-keyHeader, eligible existing key stringThe examples use SERVICE_API_KEY with resource. Choose one supported credential context.
idRequired digits-only team path IDTeam record ID, not a team relationship or catalog subscription ID.
user_idRequired digits-only account path ID on single operationsGlobal reader account ID, not a team-member relationship ID.

For attachment, choose a team associated with the publication’s partner. Removal uses the caller’s available active publication/partner affiliations or service-account ownership and can cover a wider set of teams. Root has broader removal access. Use the intended team and account IDs from your authorized records.

Confirm each intended account’s eligibility from your audience and team records before sending. The caller must be active; their current publication relationship, when present, must not be locked or suspended.

All three attachment routes share these effects:

  • A positive member_limit counts all stored team links, including inactive statuses. A full team can reject reattachment; this is not a net-new-active-seat count.
  • Verify each intended reader’s email-domain eligibility against the team’s configured rules before submitting.
  • Attachment sets the link active with team role user. Single requests have no role/status/owner selector and do not change the global account role or stored team owner.
  • With never_lock enabled, attachment can set global never_lock true across publications. Removal does not undo it.
  • A configured subscription can create or replace memberships, archive old records and affect others under single-subscription settings. Dates use the catalog period or team end date; unused time is not always added. A caller different from the reader creates autorenew false. This is membership processing, not a charge or provider-cancellation receipt.

When attachment replaces memberships, configured cleanup can clear the reader’s stored content-view records across publications. A request may save links or global settings before membership/event work fails. Even a completed response does not confirm every link or setting was saved. Repetition can reset roles, reactivate links or process memberships again. Inspect current state before retrying; earlier changes may remain.

Example conventions

Examples use fictional team 7001, accounts 1002/1003 and illustrative excerpts. They show alternative routes, not a sequence to repeat. Assume intended eligibility, capacity and integration context. 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 SERVICE_API_KEY. Keep privileged calls in trusted server code.

Attach a list of known accounts

POST /api/v1/admin/teams/{id}/users

Process a list of account IDs. Each is handled separately; a partial failure can leave earlier link, global-setting or membership changes.

Before you call

Use the allowed credential and publication context. Review eligibility, email restrictions, capacity and subscription effects. Existing members and duplicate IDs can consume the precheck’s count.

Request

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

InputLocation / typeMeaning and limits
user_idsJSON array of numeric account IDs; send explicitlyCandidates to process. Use the explicit array request form; malformed, missing or non-countable lists do not have a uniform invalid-input response.
filterOptional audience-selection query map or JSON-encoded objectSelects a publication audience instead of the explicit body IDs. Review the complete selected audience and its capacity/email eligibility. See audience collection inputs for field-dependent filter limits. Examples omit it.

Capacity calculations include existing links and submitted candidate counts, including duplicates. A filter can select a different audience, so review the final intended accounts and available capacity before attachment. More than 1000 selected candidates is rejected; that count does not represent unique new members or confirm available seats. This selection is not paginated. Use reviewed explicit IDs for the example’s task.

Bulk role/status/date/renewal fields are not consumed. Each candidate uses the shared attachment behavior, including role reset and possible membership/global-setting changes.

Response

HTTP 200 returns result:true and affected_rows, counting account processing paths that completed without reported error. It is not verified new rows, unique readers or new seats. Reprocessed existing links can count.

If per-account errors occur, HTTP 207 returns error, error_description as an array of strings, and req_guid. result and affected_rows are absent. There may be zero successful accounts; the response does not list every successful ID.

Example: Process two reviewed readers

curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/teams/7001/users" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "service-api-key: ${SERVICE_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-raw '{"user_ids": [1002, 1003]}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7001/users`, {
  method: "POST",
  headers: {"resource": process.env.RESOURCE_KEY, "service-api-key": process.env.SERVICE_API_KEY, "Content-Type": "application/json"},
  body: JSON.stringify({"user_ids": [1002, 1003]})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

body = json.dumps({'user_ids': [1002, 1003]}).encode("utf-8")
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7001/users",
    headers={"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"], "Content-Type": "application/json"},
    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 result:

{"result":true,"affected_rows":2}

Two account-processing paths completed without reported errors. Inspect actual links and memberships; two new rows or paid memberships are not established.

Some accounts report errors

A request including unresolved account 9999 can return:

{"error":"part_of_complete","error_description":["User #9999 not found"],"req_guid":"example-request"}

Other accounts may have completed or partially changed. Inspect each intended account before repeating; there is no success count, and omitted work is not verified success.

Recovery

Use shared recovery, plus:

HTTP statusAPI code / shapeCauseNext action
409invalid_team_idTeam validation, current capacity or applicable eligibility check fails.Confirm team/capacity and reader eligibility with the operator; current counts include all statuses.
404team_not_foundNo team in attachment’s selected partner-association scope.Confirm team ID and publication.
409limit_reachedOriginal candidate count plus existing relationships exceeds a positive cap.Review current relationships and the intended candidate set; existing/duplicate IDs are not excluded automatically.
409not_valid_dataSelected candidate count above 1000.Use a smaller reviewed candidate list while accounting for earlier possible changes.
404users_not_foundReported filter-selection failure.Check the intended audience/filter; an empty selected set can otherwise produce zero affected rows.
406incorrect_filter_date / incorrect_filterReported audience-filter construction error.Correct supported fields/values; not every invalid filter is uniformly rejected.
207part_of_complete, array error_descriptionPer-account errors; partial or zero successful processing possible.Read every error and reconcile individual state; do not invent missing success counts.
409store_team_users_errorAnother caught bulk failure.Retain request context and inspect earlier changes before repeating.
406result:falseInput reached the fallback without a usable candidate-list branch; other malformed inputs can fail differently.Send an explicit numeric array; do not treat this as a universal invalid-JSON response.
Not uniformMalformed/missing user_ids or other unhandled input failureNot every list/type failure is normalized.Send an explicit numeric array; inspect uncertain effects with the operator.

Next task

Read attached accounts with an allowed Admin token and inspect current memberships. Check content access separately.

Attach or reactivate one account with PUT

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

Attach or reactivate an account and set team role user, including a prior owner/admin link. This is the same operation as single POST below.

Before you call

Send an allowed token or service key with resource, intended team ID and account ID. The team must match the publication’s partner association. Review capacity and each reader’s email eligibility; a full team can reject reattachment.

Request

Send the path and headers without a body. Attachment uses the team role user and the shared settings described in attachment effects. See the single response.

Response

HTTP 200 returns the global user with teams:[] and no subscriptions field. It does not return the saved team role or verify every related write.

Example: Attach reader 1002

curl -X PUT "${WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1002" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "service-api-key: ${SERVICE_API_KEY}"
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1002`, {
  method: "PUT",
  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

request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7001/users/1002",
    headers={"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]},
    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":"reader@example.com","first_name":"River","active":true,"extra":{},"uid":null,"language":null,"locked":false,"can_own_teams":false,"teams":[]}

The id identifies reader 1002. Empty teams is a response rule, not proof attachment failed. Membership work may have happened despite the absent subscriptions field.

Reattachment is refused at capacity

HTTP 409 error excerpt:

{"error":"invalid_team_id","error_description":"Reached the limit of teams users."}

Existing links count toward capacity, even for reactivation. Inspect the team and account before repeating; PUT is not a role-preserving idempotent refresh.

Recovery

Use single-attachment recovery. A failure can follow saved links or global settings.

Next task

Inspect the team roster and memberships. Use the content-access guide for protected content.

Attach or reactivate one account with POST

POST /api/v1/admin/teams/{id}/users/{user_id}

Use this alternative to single PUT. Both can create/reactivate a link, set it active and reset role to user. POST does not guarantee a new row; repeating can process membership effects again.

Before you call

Use the same allowed credential, publication, team and account context as PUT. The same capacity/email limitations and subscription/global never_lock effects apply. Team ownership is separate from global account role.

Request

Send the path and headers without a body. The path selects the intended team and account; role, status, trial, renewal and end-date settings are not inputs to this request.

Response

HTTP 200 uses the single response: global user plus teams:[], without subscriptions, result or affected_rows. It does not confirm a new row or all membership effects.

Example: Attach reader 1003 with POST

curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1003" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "service-api-key: ${SERVICE_API_KEY}"
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1003`, {
  method: "POST",
  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

request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7001/users/1003",
    headers={"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]},
    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 200 response excerpt:

{"id":1003,"email":"other-reader@example.com","first_name":"Alex","active":true,"extra":{},"uid":null,"language":null,"locked":false,"can_own_teams":false,"teams":[]}

This is the global account profile. Absent membership fields do not mean memberships stayed unchanged.

Attachment reports a failure after earlier work

HTTP 406 excerpt:

{"error":"attach_user_to_team_fail","error_description":"Attache user to teams fail"}

The link or global settings may already have changed. Other follow-on failures can use different responses. Inspect state before repeating.

Recovery

Use single-attachment recovery. The returned profile does not confirm that an existing role was preserved.

Next task

Inspect the team roster and memberships. Removal below uses a different visibility rule.

Remove one team relationship

DELETE /api/v1/admin/teams/{id}/users/{user_id}

Remove the user-team link, leaving the global account and team. This does not explicitly cancel memberships/provider billing, revoke sessions or reset global never_lock. Other grants or memberships can still allow access.

Before you call

Send an allowed token or service key, resource and both numeric IDs. Removal uses caller-available active publication/partner associations, not attachment’s selected-partner rule. Root is also an allowed caller; use the intended team from your authorized records. The account and exact team link must exist.

Removing an owner-role link does not clear the team’s stored owner reference.

Request

Send the path and headers without a body. There are no cancellation, refund, membership-downgrade or global-setting reset options.

Response

HTTP 200 returns result as the boolean delete outcome. An event may already have been emitted even when the delete reports false. Inspect both the current link and related effects after an uncertain result before repeating removal.

Example: Remove reader 1002 from team 7001

curl -X DELETE "${WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1002" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "service-api-key: ${SERVICE_API_KEY}"
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7001/users/1002`, {
  method: "DELETE",
  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

request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7001/users/1002",
    headers={"resource": os.environ["RESOURCE_KEY"], "service-api-key": os.environ["SERVICE_API_KEY"]},
    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}

The link delete reported success. Review independent memberships, access and global settings as needed.

Delete reports false

HTTP 200 result:

{"result":false}

Inspect the current link and emitted-event effects before repeating. HTTP success alone does not confirm removal.

Recovery

Use shared recovery, plus:

HTTP statusAPI code / shapeCauseNext action
404team_not_foundNo team permitted by this removal lookup.Confirm the intended team and caller’s available associations with the operator.
404user_not_foundGlobal account missing.Confirm reader ID.
404user_team_not_foundNo selected account/team relationship.Inspect current state; a prior removal may already have applied.
409delete_team_users_errorCaught event/delete processing failure.Retain request reference and inspect state; earlier effects are not guaranteed reversed.
200result:falseChecked delete did not report success.Do not infer removal; ask the operator to investigate.

Next task

Inspect the roster and independent memberships/access. Provider billing and sessions need their own workflows.

Single-attachment recovery

Both PUT and POST use these additional outcomes alongside shared recovery:

HTTP statusAPI code / shapeCauseNext action
409invalid_team_idTeam validation, applicable activity rule, capacity or eligibility failed.Confirm team/eligibility/current relationship counts; even an existing member can fail at capacity.
409invalid_user_idGlobal-account validation failed.Correct the intended reader ID.
404team_not_foundNo team in attachment’s selected partner-association scope.Confirm team ID and publication.
404user_not_foundGlobal account missing at later lookup.Confirm it still exists; validation and mutation are not one guaranteed atomic step.
406attach_user_to_team_failA caught team-attachment error.Inspect relationship/global-setting state before repeating.
Not uniformly specifiedOther membership/processing failureNot every follow-on failure is normalized into the same error.Reconcile related state with the operator; do not assume no writes occurred.

Inactive teams are rejected when the caller lacks authorized Admin context; credential types can differ here. Reattachment can change team roles, dates or membership state.

Shared recovery

Errors normally include error, error_description and req_guid. Bulk 207 uses an error_description array rather than text. Keep request context for your operator.

HTTP statusAPI code / shapeCauseNext action
401 / 403accessCaller lacks eligible role or specific service-account action grant.Confirm existing credentials and the required action with the operator.
401auth_failedRequired caller identity did not resolve.Check credential and chosen custom header.
401auth_access_failCaller inactive or its current publication relationship locked/suspended.Ask the operator to inspect restrictions.
401token_expired / token_compromisedApplicable session check rejects credential.Use an existing current authorized credential.
404resource_not_existsPublication key does not resolve.Confirm the public resource key; changing reader/team IDs does not repair it.
409initialize_failedShared context initialization failed.Retain request reference and context for the operator.

Single-attachment response

Both single methods return HTTP 200 with shared account fields at the top level, not result:true or a team object:

Returned field/objectMeaning
Global userShared User fields: profile/contact fields, activation/confirmation, global activity and photos.
extraEmpty object, not publication-reader extra.
uid, user_resource_created_at, languageNull; publication-specific values are not supplied.
locked, can_own_teamsFalse in this response; inspect publication lock state and team ownership separately.
settings, roleConditional Admin fields: null settings and global role, not the selected-team role. They may be absent from service-account responses.
teamsEmpty array even after attachment. It does not establish that the link is absent.

No subscriptions field is added, even after team-subscription work. Team-link ID/role/status, affected_rows, tags, last_action and new session/refresh token are also absent. Inspect links and memberships separately.

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