Skip to main content

Sub-Teams, Hierarchy & Scoped Visibility

Sub-Teams allow multi-country, multi-brand, or multi-department enterprises to operate under a single Verifik billing wallet while isolating sensitive PII records, enforcing monthly spend limits, locking Cost Centers (CECOs), and issuing scoped server-to-server API credentials.


Sub-Team Model & parentTeam Hierarchy​

Every Sub-Team can optionally link to a parentTeam, enabling clean regional or departmental inheritance without duplicating workspaces:

Workspace (Owner / Global Admin)
├── LATAM Regional (parentTeam: null, team_manager sees all children)
│ ├── Colombia Ops (parentTeam: LATAM Regional, CECO: CO-OPS, $1,500/mo)
│ └── Mexico Ops (parentTeam: LATAM Regional, CECO: MX-OPS, $2,000/mo)
└── Shared Risk Templates (visibility: "workspace" blueprints, no PII results)
  • Cycle detection: Creating or updating a team validates ancestry to reject direct self-references and transitive loops (A -> B -> A).
  • Safe deletion (DELETE /v2/teams/:id):
    • Direct child teams automatically reparent to the deleted team's parentTeam (null if it was a root team).
    • References inside Staff.additionalTeams are automatically pulled and cleaned up.
    • Pass reassignToTeamId in the query/body to migrate primary staff members and team-owned resources atomically.

Primary (team) vs. Secondary (additionalTeams) Memberships​

Verifik separates a staff member's primary team from any secondary memberships:

  • team (primary Sub-Team): Single anchor team used to attribute newly created reports, batches, projects, and lookups when a staff member runs actions in the portal.
  • additionalTeams (secondary array, up to 20 team IDs): Grants cross-unit read access (and subtree management rights for a team_manager) without creating duplicate staff accounts.

For any staff member, the effective visible Sub-Team set (teamIds) is the union:

primary team ∪ additionalTeams ∪ all recursive parentTeam descendants

Anti-escalation & write boundaries

additionalTeams grants read and management visibility (depending on role), while POST/PUT resource creation still anchors to teams inside the actor's allowed scope. Assigning a team outside the caller's managed scope returns 403 team_out_of_scope.


Monthly Budgets, Per-Endpoint Caps & Boosts​

Each Sub-Team tracks live credit consumption across UTC billing months and enforces limits before upstream verification providers are invoked:

FieldPurposeBehavior
status"active" or "paused"Paused teams immediately return 403 team_paused
monthlyBudgetWorkspace credit cap (USD) or null for unlimitedEvaluated before execution on API lookups and metered SmartReports
budgetEnforcement"hard" (default) or "soft""hard" blocks at >= 100% with 403 team_budget_exceeded; "soft" allows execution while emitting warning metadata/alerts
featureBudgetsArray of { endpointPrefix, monthlyLimit } capsCaps expensive sources individually (for example /v2/co/runt/vehiculo), throwing 403 team_feature_budget_exceeded

Temporary & Recurring Budget Boosts (POST /v2/teams/:id/boost)​

When a regional team hits its monthly cap mid-campaign, a team_manager (within their subtree) or global admin can top up capacity without editing the base team policy:

curl -X POST https://api.verifik.co/v2/teams/<TEAM_ID>/boost \
-H "Authorization: Bearer $MANAGER_JWT" \
-H "Content-Type: application/json" \
-d '{
"amount": 250,
"mode": "current_month",
"reason": "Month-end driver onboarding surge"
}'

Cost Center (CECO) Locking & Resolution Order​

Sub-Teams bind directly to Verifik Cost Centers (POST /v2/cost-centers) so every verification call and SmartReport run carries accurate accounting attribution:

  • defaultCostCenter: Automatically stamped whenever a caller in that Sub-Team (Staff or Team API key) omits the x-cost-center header.
  • allowedCostCenters: Whitelist of Cost Center IDs permitted for the team.
  • enforceCostCenter: When true, any request specifying an x-cost-center outside [defaultCostCenter, ...allowedCostCenters] is rejected before upstream execution or billing with 400 cost_center_not_allowed_for_team.

Team-Scoped Visibility (teamScopedVisibility) & Shared Blueprints​

By default on legacy accounts, all workspace staff with module read permission see workspace-wide records. To enforce strict Sub-Team isolation, set staffAccessPolicy.teamScopedVisibility: true via PUT /v2/client-settings (or Team & Access → Access Policy).

When enabled, callers lacking team.readAll are scoped by their effective teamIds across these 11 resource collections:

  1. SmartReport
  2. SmartBatch
  3. BatchConfiguration
  4. SmartReportTemplate
  5. Project
  6. ProjectFlow
  7. AppRegistration
  8. DocumentValidation
  9. BiometricValidation
  10. APIRequest (lookup & usage history)
  11. StaffAuditLog

Shared Configuration Blueprints (visibility: "workspace")​

For teams with centralized designers (like a report_builder) creating reusable templates that every country team executes independently:

  • SmartReportTemplate, BatchConfiguration, Project, and ProjectFlow support visibility: "workspace".
  • Staff in any Sub-Team can read and execute those shared blueprints, while the resulting runs, PDFs, and applicant PII (SmartReport, SmartBatch, AppRegistration) remain strictly locked inside the executing team.
  • Bulk-assign existing legacy assets or toggle shared blueprint visibility with POST /v2/teams/:id/assign.

Team-Scoped API Keys (POST /v2/teams/:id/api-keys)​

Instead of distributing an unscoped workspace token across country microservices, mint a dedicated Sub-Team API Key ({ clientId, teamId }).

# 1. Mint a Sub-Team API key
curl -X POST https://api.verifik.co/v2/teams/<CO_TEAM_ID>/api-keys \
-H "Authorization: Bearer $OWNER_OR_ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"name": "colombia-kyc-worker",
"expiresIn": "1y"
}'

# 2. Call any lookup or SmartReport endpoint using that Team API Key
curl -X POST https://api.verifik.co/v2/smart-reports/run \
-H "Authorization: Bearer $CO_TEAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"systemKey": "co.citizen.comprehensive",
"inputs": { "documentType": "CC", "documentNumber": "123456789" },
"mode": "sync",
"generatePdf": true
}'

When staffAccessPolicy.requireTeamApiKeys: true is enabled in workspace settings, plain client API keys lacking a teamId claim are rejected from API execution endpoints with 403 team_api_key_required.

Next in this section