Create, update and remove customer teams
Create a team, edit its settings or remove it. A team can serve several publications under the same partner. Check where it is used before you change it.
| Task | Operation |
|---|---|
| Create a team | POST /api/v1/admin/teams |
| Update team settings | PUT /api/v1/admin/teams/{id} |
| Remove a team | DELETE /api/v1/admin/teams/{id} |
Keep the created team’s id for later changes. Team settings, team relationships and reader memberships are separate. A team response does not confirm every member change, notification or provider action.
Existing context and identifiers
Allowed roles: support, admin, partner; root is also permitted. Send an existing authorized token. Service accounts cannot use these routes, including those with full_access.
| Input | Location / type | Meaning |
|---|---|---|
| resource | Required header, publication public-key string | Selects the existing publication and its partner association. Not a numeric partner/resource ID or a secret. |
| token | Required header, existing authorized token string | ADMIN_TOKEN in examples is this credential; the target reader’s ordinary token does not automatically grant team management. |
| id | Required digits-only path value for update/delete | Team ID from discovery or creation, not a user, owner relationship or catalog subscription ID. |
Use the assigned integration context and choose the intended team from discovery. Create associates the team with the publication’s existing partner; there is no partner_id input. Updates and deletion can affect shared or inactive teams. The caller must be active; their current publication relationship, when present, must not be locked or suspended.
Example conventions
Examples use fictional team 7002 and illustrative response excerpts. 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.
Create a simple team
POST /api/v1/admin/teams
Create a team for the publication’s existing partner. The example sets basic details without adding members or invitations.
Before you call
Send the authorized token and publication key. The publication must already have its partner association.
Supply a nonempty name, at most 255 characters before filtering, and an explicit type. Read optional fields before supplying owner, subscription or invitation values: they add writes, and create does not reliably assign the requested owner.
Request
Send a JSON object with Content-Type: application/json.
| Field | Type / requirement | Meaning |
|---|---|---|
| name | Required string, max 255 | Team name, trimmed/string-filtered with markup removed on create. |
| type | Optional accepted classification string | The example uses company; exact choices are in the field table. |
| active | Optional boolean; create defaults true when omitted/null | Team activation setting, not proof of individual access. |
| never_lock | Optional boolean | Team setting that can affect global user lock-prevention settings on later changes. The example explicitly uses false. |
| member_limit | Optional integer input | Configured member-limit value; setting it does not prove current seat usage. |
See supported fields and effects before adding inputs. A failure can leave the team or related writes behind, and a response does not confirm every optional change. Inspect state before repeating create.
Response
HTTP 201 returns the team result at the top level, with detailed subscription and all associated invitation usage records. There is no separate success flag or confirmation of every owner/member/invitation write.
Example: Create without a subscription or invitations
curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/teams" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data-raw '{"name": "Example readers", "type": "company", "active": true, "never_lock": false, "member_limit": 10}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams`, {
method: "POST",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
body: JSON.stringify({"name": "Example readers", "type": "company", "active": true, "never_lock": false, "member_limit": 10})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
body = json.dumps({'name': 'Example readers', 'type': 'company', 'active': True, 'never_lock': False, 'member_limit': 10}).encode("utf-8")
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams",
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "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 201 response excerpt:
{"id":7002,"name":"Example readers","active":true,"type":"company","never_lock":false,"member_limit":10,"subscription_end_date":null,"users_count":0,"invites_count":0,"subscription":{},"invites":[]}
Keep team ID 7002. It has no subscription, end date, members or invitations in this example. Empty subscription is an object; invites is an array.
Name validation fails
HTTP 409 error excerpt for a name exceeding the maximum:
{"error":"invalid_name"}
Correct the name before repeating. The validation-supplied description is omitted here. Later failures can follow writes and need state inspection before retry.
Recovery
Use shared recovery, 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 with the correct media type. |
| 409 | invalid_name, invalid_type, invalid_subscription_id, invalid_subscription_end_date, invalid_user_id | A supplied value fails its applicable validator. | Correct the named field; validation does not prove later optional writes will succeed. |
| Not uniformly specified | Later context/save/owner/invitation/event failure | Some steps can fail after a team or related record was written. | Retain request context and inspect team/related state with the operator before retrying. |
Next task
Inspect the team, then update settings. Repeated create is not an upsert.
Update team settings
PUT /api/v1/admin/teams/{id}
Edit a team visible through the partner association. Subscription, end-date and never_lock changes can affect existing memberships or global user settings.
Omitted or null subscription_id and subscription_end_date clear those settings, even in a name-only update. To keep either setting, read it first and send its current value. Most other omitted/null fields preserve values; these two differ.
Before you call
Use the token, publication key and numeric team ID. Check shared-publication use and the member effects below before changing settings; effects can differ between members.
Request
Send JSON with Content-Type: application/json. See the field table. A supplied name must be nonempty and at most 255 characters. Send only name when clearing both subscription settings is intended or they are already unset.
Response
HTTP 200 returns the team result. Team and member changes can have different outcomes; inspect saved state after an uncertain result. Owner-role relationship changes may leave the displayed stored owner unchanged.
Example: Rename a team already known to have no subscription settings
Team 7002 already has no subscription or end date. A name-only request leaves those settings unset. For a configured team, resend the current values to preserve them.
curl -X PUT "${WALLKIT_API_BASE}/api/v1/admin/teams/7002" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data-raw '{"name": "Renamed readers"}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7002`, {
method: "PUT",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
body: JSON.stringify({"name": "Renamed readers"})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
body = json.dumps({'name': 'Renamed readers'}).encode("utf-8")
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7002",
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
method="PUT", 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":7002,"name":"Renamed readers","active":true,"type":"company","subscription_end_date":null,"users_count":0,"invites_count":0,"subscription":{},"invites":[]}
The response shows the new name and unset team subscription settings. It does not establish that independent memberships were removed.
A name-only update clears configured settings
For a team with subscription/end-date settings, the same name-only body clears both. An illustrative response can still look like:
{"subscription":{},"subscription_end_date":null}
If clearing was unintended, inspect the team and member memberships before attempting repair. Earlier member effects may not reverse automatically.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | team_not_found | Team missing or outside the selected partner-association scope. | Confirm ID and publication from discovery. |
| 406 | incorrect_data | Missing JSON or a value treated as empty by the API. | Send an object and the correct media type. |
| 409 | invalid_name, invalid_type, invalid_subscription_id, invalid_subscription_end_date | Supplied value fails validation. | Correct input; include current subscription/date values if preservation is intended. |
| 200 | Team settings changed but some member effects uncertain | Related changes can have different outcomes. | Inspect actual memberships/global user settings before deciding what to repeat. |
| Not uniformly specified | Save/related-record/owner/invitation/event failure | Failure can follow earlier writes. | Retain request context and reconcile affected records; do not assume complete rollback. |
Next task
Inspect the team and affected readers’ current memberships.
Remove a team
DELETE /api/v1/admin/teams/{id}
Delete the team record, not just its selected publication/partner association. Other sharing publications or associations can be affected. Reader memberships are separate; team deletion does not guarantee membership cancellation or loss of access.
Before you call
Use the token, publication key and intended team ID. Review shared use before deletion. Team/partner links can be removed while reader memberships remain with their team link cleared; the outcome depends on the deployed database rules. Inspect the remaining memberships afterward.
After deletion, inspect shared never_lock preferences, reader memberships and sessions. Handle account removal, billing cancellation and refunds through their separate workflows; the delete result does not confirm those outcomes.
Request
Send the path and headers without a body. There is no billing-cancellation or complete invitation/member-cleanup option.
Response
HTTP 200 returns result, the boolean delete outcome. Snapshot work can fail before deletion; event work can fail afterward and prevent the normal response. False is possible. There is no whole-request transaction or safe automatic retry guarantee.
Example: Remove the empty example team
Team 7002 has no members, invitations or subscription in this example. Other teams can have wider effects.
curl -X DELETE "${WALLKIT_API_BASE}/api/v1/admin/teams/7002" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/teams/7002`, {
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
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/teams/7002",
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}
The delete reported success. Inspect remaining independent memberships, access and billing where relevant.
Deletion reports false
HTTP 200 result:
{"result":false}
Check current visibility before marking the team removed. Ask your operator to investigate a false delete result.
Recovery
Use shared recovery, plus:
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 404 | team_not_found | No visible team for this ID/publication association. | Confirm context; a prior deletion may already have taken effect. |
| 200 | result:false | Team delete did not report success. | Inspect current team and related state before repeating. |
| Not uniformly specified | Snapshot/delete/event failure | Error may occur before or after deletion. | Retain request context and reconcile state; do not infer complete rollback. |
Next task
Check team discovery and affected reader memberships. Use separate access and billing workflows for those decisions.
Fields and existing-member effects
Both writes use JSON. Unknown fields do not make other team properties writable. user_id and invites can add related writes.
| Field | Type / constraints | Create | Update and effects |
|---|---|---|---|
| name | Nonempty string when required/supplied, max 255 | Required; string/trim filtering and markup removal. | Optional; string/trim filtering. Omission/null preserves. |
| description | Optional stored text input | Assigned when non-null. | Omission/null preserves. Use the intended stored description text. |
| type | Exact string: personal, company, company_subdivision, organization, educational_institution, multi_user | Validation precedes lowercase/trim storage. Supply an explicit type; no omitted default is specified here. | Same validation; omission/null preserves. |
| member_limit | Optional integer input | Configured team member-limit value; use an integer appropriate to the intended team. | Does not trim links or prove seats are available. Attachment/invitation checks can use positive limits. |
| allowed_email_regexp | Optional patterns; use an array | Converted to an array before storage. | Strings can split on commas; omission/null preserves. Use valid intended patterns; changing them does not immediately revoke existing members. |
| active | Optional boolean | Omission/null defaults true. | Omission/null preserves. Disabling does not explicitly revoke sessions or cancel all memberships. |
| never_lock | Optional boolean | Example supplies false; no omitted default is specified here. | A change affects shared reader lock-prevention preferences for active team links across publications. Per-member changes may not complete even when the request returns a response; inspect the outcomes. |
| subscription_id | Optional existing global catalog subscription ID | Choose an existing catalog subscription from the intended publication/customer context. | Omission/null clears it. Changes can process active role=user links and alter their memberships; complete migration is not guaranteed. |
| subscription_end_date | Optional nonempty parseable date/time string | Time of day is discarded; stored at midnight as Y-m-d H:i:s. Timezone unspecified; select the intended calendar date explicitly. | Omission/null clears it. A nonempty change can add missing memberships for active role=user links and change team-linked membership dates. Clearing this setting may leave member dates unchanged. |
| user_id | Optional existing global account ID, not team ID | Create does not reliably assign the requested owner. Owner-related processing may fail after a team write; omitted from the example. | A nonempty/nonzero value can attach/update an owner-role link without changing stored owner or global role. Use the intended existing account; failures do not all use one invalid-user response. |
| invites | Optional nonempty invitation-object collection | Can create/update invitations after creation. | Can create/update after save; omission/empty does not erase invitations. Use invitation IDs from the intended team and publication. Notifications or validation/missing-record errors can follow. |
Use JSON booleans. Omission, null, false and empty text differ. For patterns, use explicit arrays; create and update handle strings differently.
Subscription and date changes can affect existing memberships
A subscription change processes active team relationships with role user. It can create or replace Plan memberships, archive old ones and remove others under single-subscription settings. When old memberships are removed, configured cleanup can clear the reader’s stored content-view records across publications. Choose the catalog subscription from the intended publication/customer context and inspect affected memberships afterward. This does not take a payment transaction or confirm provider changes.
A nonempty end-date change runs instead of the subscription-change branch, not as a guaranteed second pass. It can add missing team-subscription memberships and change team-linked end dates. Clearing the date skips that propagation. Changing both values does not guarantee two passes; member failures may not be reported individually.
Clearing the team subscription does not guarantee removal or preservation of all member memberships. Inspect before repair or retry. never_lock changes write global settings for active relationships; team deletion does not undo them.
Embedded owner and invitation inputs
The stored owner and owner-role relationships can differ. Create does not reliably assign submitted user_id; update can change the relationship without the stored owner. The examples omit it. Neither assigns a global role.
invites can create or update invitations, assign their team/title values and emit notifications. Choose existing invitation IDs from the intended team/publication records. Embedded invitations add validation and partial-failure paths; inspect the saved invitations and notification outcomes after an uncertain result.
Team result
Create and update return these fields:
| Returned object | Fields and meaning |
|---|---|
| Team | Full team for an authorized Admin context: 11 base fields, optional full global owner, users_count and invites_count. Counts include all linked relationships/invitations. Otherwise the public-team subset applies, with a short owner. Subscription and invites follow this table. |
| subscription | General subscription with subscription detail Plan when the lookup qualifies; a compact Plan can be returned instead. Empty {} if none resolves. No separate plan field or extra Plan timestamps. |
| invites | All associated invitations with usage/mail records, not just submitted/new ones. Empty [] if none. The linked schema defines invitation fields, conditional related objects, used global users, activations, sent-mail records and availability. |
This differs from invitation-list team objects, which have an empty subscription array. Invitation codes are redeemable values, not session tokens. The displayed owner uses the stored reference, not necessarily an owner-role relationship added by update. No roster or per-member role/status array is added. The linked definitions cover dynamic values, scalar types, dates and money. No new authentication token is returned.
Shared recovery
Errors normally include error, error_description and req_guid. Embedded invitations can add 404 invite_not_found or 409 field errors after earlier team writes. Keep request context and inspect state before repeating.
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 401 / 403 | access | Caller lacks the required role/action. | Use the permitted existing Admin context; service keys cannot use these mutations. |
| 401 | auth_failed | Required caller identity missing. | Check credential and custom token header. |
| 401 | auth_access_fail | Caller inactive or current caller/publication relationship locked/suspended. | Ask the operator to inspect restrictions. |
| 401 | token_expired / token_compromised | Applicable session check rejects token. | Use an existing current authorized credential. |
| 404 | resource_not_exists | Publication public key does not resolve. | Confirm the public key; changing team ID does not repair it. |
| 409 | initialize_failed | Shared context initialization failed. | Supply request reference and selected context to the operator. |
Team, member, invitation and event work is not all-or-nothing. Team deletion does not guarantee invitation deletion/retention, membership cancellation or provider rollback.