---
title: "corestack_external_db_user_update"
url: https://docs.corefinity.com/mcp/tools/corestack_external_db_user_update
type: tool
last_updated: 2026-11-13
feature: database
related:
  - https://docs.corefinity.com/api/reference/database/update-site-database-user.md
  - https://docs.corefinity.com/guides/sites/database/database-users.md
---
# corestack_external_db_user_update

**Change a database user.** Change a database user's access (read-only or read-write) and, for an external user, its limits and require-TLS. Open sessions keep their old settings until they reconnect. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Confirmation: `confirm_read_write`
- Runs as a task: yes

## When to use it

Change a database user's access and, for an external user, its limits and require-TLS. The name and the kind never change: to rename a user or move it between internal and external, remove it and add a new one. Send only what changes; an absent argument stays as it is, and null clears a limit.

Raising a user to read-write lets it change and delete data in the environment's database: ask the person first and send `confirm_read_write: "read-write"`. Lowering it to read-only needs no confirmation.

The change applies within a minute. Open sessions keep their old settings until they reconnect. `application`, the site's own login, is never changed here.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `username` (string, required): the user's name from corestack_external_db_get.
- `scope` (string): `read_only` or `read_write`.
- `max_user_connections` (integer or null, ≥ 0): external users only; null clears it.
- `max_statement_time` (integer or null, ≥ 0): external users only, seconds; null clears it.
- `require_tls` (boolean): external users only.
- `confirm_read_write` (string): raising the user to `read_write`, the text `read-write`.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_read_write": {
      "description": "Raising the user to read_write: type read-write.",
      "type": "string"
    },
    "max_statement_time": {
      "description": "External users: the longest query in seconds; null for none.",
      "type": [
        "integer",
        "null"
      ]
    },
    "max_user_connections": {
      "description": "External users: most connections at once; null for none.",
      "type": [
        "integer",
        "null"
      ]
    },
    "require_tls": {
      "description": "External users: refuse connections without TLS (encrypted, not CA-verified).",
      "type": "boolean"
    },
    "scope": {
      "enum": [
        "read_only",
        "read_write"
      ],
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "username": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "site_id",
    "username"
  ],
  "type": "object"
}
```

## Refusals

- `confirm_mismatch`: raising the user to read-write without `confirm_read_write: "read-write"`; nothing changed.
- `user_not_found`: no user of that name on this environment that can be changed here.
- `unchanged`: the user already has these settings.
- `invalid_arguments`: a limit or TLS for an internal user, or a value out of range; `fields` names each.
- `busy`: another change to this environment is applying.
- `deleted`: the site is deleted (in its grace period).
- `provisioning`: the site is still being created.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_external_db_user_update",
  "arguments": {
    "site_id": 4211,
    "username": "oms_reader",
    "max_user_connections": 10,
    "max_statement_time": 300
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_external_db_user_update with site_id 4211, username oms_reader, max_user_connections 10, max_statement_time 300. (Change a database user.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PATCH /api/corestack/sites/{site}/database/users/{username}](https://docs.corefinity.com/api/reference/database/update-site-database-user.md)
- Guide: [Database users](https://docs.corefinity.com/guides/sites/database/database-users.md)
