reset_user_key
Issue a new API key for a user and cancel the old one. The new key is returned once, here. Use it when a key is lost or leaked, or after restoring a deleted user. A warning in the answer means the key works but could not be confirmed to last; issue another when that is put right.
- It
- Changes the plan, as one step that is stored whole or not at all, and then stores the key in the config file, which is a step of its own.
- Who may call it
- Admins only. It is not listed for anyone else.
- Version
- Takes no version: it is carried out on the plan as it is at that moment.
- Answers with
- The user and its API key.
- MCP tool
reset_user_key- HTTP
POST /api/reset-user-key- Command
vigile reset-user-key
Input
| Field | Takes | What it is | |
|---|---|---|---|
user | string | required | A username or user ID. |
A field that is not listed here is refused, as invalid_input. On the command line each field is an option, with hyphens for underscores: --user.
Example
The same call three ways, as admin. It was made on the demo plan the pictures of this site show. Over HTTP, vig_... stands for the key of admin; over MCP, the client is set up with that key.
Command line
vigile reset-user-key --user agent2HTTP
curl -s http://127.0.0.1:8700/api/reset-user-key \
-H 'content-type: application/json' \
-H 'Authorization: Bearer vig_...' \
-d '{"user":"agent2"}'MCP tool call
{
"name": "reset_user_key",
"arguments": { "user": "agent2" }
}The answer
{
"user": {
"kind": "user",
"id": "USER-004",
"username": "agent2",
"type": "agent",
"built_in": false,
"version": 2
},
"api_key": "vig_…"
}
This is what a service answered when this page was built. Over HTTP it is the body of the response, over MCP the text of the tool result, and the command line prints it in words unless given --json.
What it answers
The user, and its new api_key, shown once. A warning beside it means the key works but could not be confirmed to last.
Rules
- The old key stops working when the new one is issued.
- The user is named by its username or its ID. The ID is the safer of the two for a request that may be carried out late: a username can pass to another user.
- It takes no version. Each reset that is carried out replaces the key: the last one carried out is the one in force.
- Use it when a key is lost or leaked, and after restoring a deleted user, which comes back without a key.
On the command line, vigile user reset-key calls this. For admin it also works when the service refuses the admin key or is not running.
Errors
forbidden: the caller is not an admin.not_found: no user has that name or ID.rule_violationwithdeleted: the user is deleted.internal, "No new API key could be stored": the key the user had still works. Call it again once the cause, which is in the service's log, is put right.