ziniao-workflow-batch-account

Original🇨🇳 Chinese
Translated

Batch Account Authorization Workflow: Orchestrate account list + staff list + API calls to complete batch authorization of stores to employees. Suitable for batch assigning store permissions when new employees join.

1installs
Added on

NPX Install

npx skill4agent add ziniao-open/skills ziniao-workflow-batch-account

SKILL.md Content (Chinese)

View Translation Comparison →

Batch Account Authorization Workflow

CRITICAL — MUST use the Read tool to read
../ziniao-shared/SKILL.md
before starting

Applicable Scenarios

  • "Assign store permissions to new employees"
  • "Batch authorize stores to a specific employee"
  • "New employee onboarding, need to authorize all stores"

Prerequisites

  • apiKey has been configured (
    ziniao-cli config init
    )

Workflow

staff list ──► Find target employee ID
account list ──► Find target store ID list
    ├──► For each store:
    │       api /superbrowser/rest/v1/erp/store/auth/add { storeIdList, staffId }
    └──► Summarize authorization results

Step 1: Find Employee

bash
# Search by name
ziniao-cli staff list --name "Zhang San" --format table
# Record userId

Step 2: Find Stores to Authorize

bash
# List all stores
ziniao-cli account list --format table --page-all
# Or search by name
ziniao-cli account list --name "US" --format table

Step 3: Authorize One by One

Execute for each store:
bash
ziniao-cli api /superbrowser/rest/v1/erp/store/auth/add \
  --data '{"storeIdList":["<storeId>"],"staffId":"<staffId>"}'

Step 4: Verification

bash
# View stores authorized to this employee
ziniao-cli api /superbrowser/rest/v1/erp/user/stores \
  --data '{"userId":"<userId>","page":1,"limit":10}'

Notes

  • Authorization is a write operation; confirm user intent before execution
  • If a large number of stores need to be authorized, it is recommended to list the plan and confirm first
  • Record errors and proceed to the next one if authorization fails

References

  • ziniao-account — Account Management
  • ziniao-staff — Staff Management
  • ziniao-shared — Authentication and Global Parameters