# app.tempomusic.staff.banAccount

> Published by [lexicons.tempomusic.fan](https://lexicon.garden/identity/did:plc:pxsuqmultto34oks44m2lgxm)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.banAccount)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.banAccount/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.banAccount/examples)

## Definitions

### `app.tempomusic.staff.banAccount`

**Type**: `procedure`

Permanently ban an account: all of its content disappears from the public read surface and no surface can lift the state. Escalating an active suspension replaces it. Requires the `superAdmin` role. Writes an `accountBanned` audit row. Federation caveat: the ban blocks this DID — re-registration under a fresh DID is structurally possible in AT Protocol.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `reason` | `string` | Yes |  |
| `notifyUser` | `boolean` | No | When true, persist a moderation notice addressed to the affected user (content author or account holder). Delivery is out of scope. |
| `closeAttachedReports` | `boolean` | No | Same semantics as suspendAccount: closes `open`/`underReview` reports against the ACCOUNT subject in the same transaction, with linked `reportClosedByCascade` audit rows. Reports against individual posts/replies stay open. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `auditEntryId` | `integer` | Yes |  |
| `attachedReportsClosed` | `integer` | Yes | Number of account-subject reports auto-closed in this transaction. Zero when closeAttachedReports=false or none were open. |

#### Errors

- **Forbidden**: The caller is not a super-admin.
- **AccountAlreadyBanned**: The account is already banned.

## Raw Schema

```json
{
  "id": "app.tempomusic.staff.banAccount",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "did",
            "reason"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did"
            },
            "reason": {
              "type": "string",
              "maxLength": 2000,
              "minLength": 1
            },
            "notifyUser": {
              "type": "boolean",
              "default": false,
              "description": "When true, persist a moderation notice addressed to the affected user (content author or account holder). Delivery is out of scope."
            },
            "closeAttachedReports": {
              "type": "boolean",
              "default": false,
              "description": "Same semantics as suspendAccount: closes `open`/`underReview` reports against the ACCOUNT subject in the same transaction, with linked `reportClosedByCascade` audit rows. Reports against individual posts/replies stay open."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "Forbidden",
          "description": "The caller is not a super-admin."
        },
        {
          "name": "AccountAlreadyBanned",
          "description": "The account is already banned."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "auditEntryId",
            "attachedReportsClosed"
          ],
          "properties": {
            "auditEntryId": {
              "type": "integer",
              "minimum": 1
            },
            "attachedReportsClosed": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of account-subject reports auto-closed in this transaction. Zero when closeAttachedReports=false or none were open."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Permanently ban an account: all of its content disappears from the public read surface and no surface can lift the state. Escalating an active suspension replaces it. Requires the `superAdmin` role. Writes an `accountBanned` audit row. Federation caveat: the ban blocks this DID — re-registration under a fresh DID is structurally possible in AT Protocol."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
