> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage users

Manage users in an existing user pool, including batch creation, exact-match queries, updates, and deletion

> [!NOTE]
>
> Sign in with user-pool management permissions. Omitting `--user-pool-id` selects the account default pool. Use global `--provider` to select Volcengine or BytePlus and the matching account and region

## Commands

| Command | Description |
| - | - |
| `user create` | Create 1-1000 users in a user pool (batch; reports per-user success/failure) |
| `user update` | Update one user's fields in a user pool (omitted flags keep current values; an empty string clears --name/--email/--phone) |
| `user delete` | Delete one user from a user pool (irreversible) |
| `user list` | List users in a user pool (exact-match filters; token-based pagination) |

## Field constraints

Usernames must contain 2–64 ASCII letters, digits, dots, underscores, or hyphens. They cannot start with a digit or contain consecutive dots. Names, email addresses, and external identity provider IDs have a 255-character limit. Email addresses must be valid, and phone numbers must use E.164 format. Each create batch accepts 1–1000 users. Updates can clear the name, email, or phone with an empty string, but cannot clear the username

## user create

Create 1-1000 users in a user pool (batch; reports per-user success/failure)

| Flag / argument | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | User pool ID | Account default pool |
| `--file <path>` | JSON file of users, a top-level array or `{"users": [...]}` (objects with camelCase fields); cannot be combined with per-user flags | — |
| `--preferred-username <username>` | preferred username; repeat once per user, matched by position across flags | — |
| `--name <name>` | One required display name per user | — |
| `--email <email>` | email address; repeat per user to align with --preferred-username | — |
| `--phone <phone>` | phone in E.164, e.g. +8613800138000; repeat per user to align with --preferred-username | — |
| `--external-provider-id <id>` | external identity provider id; repeat per user to align with --preferred-username | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | Provider / environment |
| `--json` | output JSON results instead of a table | `false` |
| `-h, --help` | Show command help | — |

```bash lines theme={null}
agentkit user create --user-pool-id pool-example --preferred-username alice --name Alice --email alice@example.com
```

## user update

Update one user's fields in a user pool (omitted flags keep current values; an empty string clears --name/--email/--phone)

| Flag / argument | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | User pool ID | Account default pool |
| `--user-id <uid>` | ID of the user to update | Required |
| `--preferred-username <username>` | new preferred username (cannot be empty) | — |
| `--name <name>` | new display name; pass "" to clear | — |
| `--email <email>` | new email; pass "" to clear | — |
| `--phone <phone>` | new phone in E.164, e.g. +8613800138000; pass "" to clear | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | Provider / environment |
| `--json` | output a JSON summary instead of a human-readable line | `false` |
| `-h, --help` | Show command help | — |

```bash lines theme={null}
agentkit user update --user-pool-id pool-example --user-id user-example --name "Alice Chen"
```

## user delete

Delete one user from a user pool (irreversible)

> [!WARNING]
>
> Deletion is irreversible. Check the user pool and resource IDs. Interactive terminals prompt for confirmation; scripts must pass `--yes`

| Flag / argument | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | User pool ID | Account default pool |
| `--user-id <uid>` | ID of the user to delete | Required |
| `-r, --region <region>` | cloud region (default: from provider/env) | Provider / environment |
| `-y, --yes` | skip the confirmation prompt | `false` |
| `--json` | output a JSON summary instead of a human-readable line | `false` |
| `-h, --help` | Show command help | — |

```bash lines theme={null}
agentkit user delete --user-pool-id pool-example --user-id user-example --yes
```

## user list

List users in a user pool (exact-match filters; token-based pagination)

| Flag / argument | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | User pool ID | Account default pool |
| `--email <email>` | filter by exact email address | — |
| `--preferred-username <username>` | filter by exact preferred username | — |
| `--name <name>` | filter by exact display name | — |
| `--max-results <count>` | maximum users to return in this page (0-100; 0 uses the server default) | Server default |
| `--next-token <token>` | pagination token from the previous response | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | Provider / environment |
| `--json` | output JSON results instead of a table | `false` |
| `-h, --help` | Show command help | — |

```bash lines theme={null}
agentkit user list --user-pool-id pool-example --max-results 20 --json
```

Pass the returned `nextToken` to `--next-token` to read subsequent pages; the CLI does not fetch every page automatically

## Batch input file

Create `users.json` as an array or an object containing a `users` array. Each user requires both `preferredUsername` and `name`

```json title="users.json" lines theme={null}
{
  "users": [
    {"preferredUsername": "alice", "name": "Alice", "email": "alice@example.com"},
    {"preferredUsername": "bob", "name": "Bob"}
  ]
}
```

```bash lines theme={null}
agentkit user create --user-pool-id pool-example --file users.json --json
```

Repeated flags are matched by position, and optional fields cannot outnumber usernames. A batch can partially succeed; any failed item produces a nonzero exit status. Retry only failed items

## Verify user changes

After creation or update, query the same pool by exact username and inspect the returned user ID and fields:

```bash lines theme={null}
agentkit user list --user-pool-id pool-example --preferred-username alice --json
```

The username is a lookup and login identifier. Use the returned user ID for updates, deletion, and department membership. For an empty list, check the pool, region, and filter. Use pagination tokens to continue their corresponding list query

Membership operations accept 1–100 users and report per-user results. Export the CSV template first, fill it in, then run `agentkit user import --file users.csv`.

## user get

| Option | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | user pool UID holding the user (defaults to the account's default user pool) | Account default pool |
| `--user-id <uid>` | ID of the user to fetch | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | — |
| `--json` | output the user as JSON instead of a table | Off |

```bash theme={null}
agentkit user get --user-id "$USER_ID" --json
```

## user import

| Option | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | user pool UID to import the users into (defaults to the account's default user pool) | Account default pool |
| `--file <path>` | CSV file to import. encoded to base64 automatically (cannot be combined with --users-base64) | — |
| `--users-base64 <b64>` | base64-encoded CSV content, e.g. "\$(base64 -i users.csv)" | — |
| `--content-type <type>` | import data format. only CSV is supported | — |
| `--show-template` | print the standard import CSV template (header + example row) instead of importing | Off |
| `--output <path>` | with --show-template, write the template CSV to `<path>` instead of printing it | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | — |
| `--json` | output a JSON summary instead of a human-readable result | Off |

```bash theme={null}
agentkit user import --show-template --output users.csv
```

## user add-to-group

| Option | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | user pool UID holding the group and users (defaults to the account's default user pool) | Account default pool |
| `--group-id <uid>` | group UID to add the users to | — |
| `--user-id <uid>` | user UID to add. repeat for multiple users (1-100) | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | — |
| `--json` | output JSON results instead of a table | Off |

```bash theme={null}
agentkit user add-to-group --group-id "$GROUP_ID" --user-id "$USER_ID"
```

## user remove-from-group

| Option | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | user pool UID holding the group and users (defaults to the account's default user pool) | Account default pool |
| `--group-id <uid>` | group UID to remove the users from | — |
| `--user-id <uid>` | user UID to remove. repeat for multiple users (1-100) | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | — |
| `--json` | output JSON results instead of a table | Off |

```bash theme={null}
agentkit user remove-from-group --group-id "$GROUP_ID" --user-id "$USER_ID"
```

## user change-group

| Option | Description | Default |
| - | - | - |
| `--user-pool-id <uid>` | user pool UID holding the groups and users (defaults to the account's default user pool) | Account default pool |
| `--origin-group-id <uid>` | group UID the users currently belong to (ownership check only) | — |
| `--target-group-id <uid>` | group UID to move the users to | — |
| `--user-id <uid>` | user UID to move. repeat for multiple users (1-100) | — |
| `-r, --region <region>` | cloud region (default: from provider/env) | — |
| `--json` | output JSON results instead of a table | Off |

```bash theme={null}
agentkit user change-group --origin-group-id "$OLD_GROUP_ID" --target-group-id "$NEW_GROUP_ID" --user-id "$USER_ID"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.