# app.tempomusic.staff.takedownSubject

> 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.takedownSubject)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.takedownSubject/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.takedownSubject/examples)

## Definitions

### `app.tempomusic.staff.takedownSubject`

**Type**: `procedure`

Flip `moderation_status` on a subject row to a non-zero takedown class. Read paths immediately refuse to serve the subject (404 on getPost / getReply / actor reads). Re-takedown against an already-taken-down subject is permitted as a severity escalation (e.g. `reported` → `legalHold`) or to amend the reason; each call writes a new audit row. Scoped to the subject row ONLY: an account takedown flips the profile row (offensive avatar/bio case) and does not touch the account's content — hiding everything an account produced is the job of suspendAccount/banAccount, which are enforced at read time, trivially reversible and cover content posted while sanctioned. Requires the caller to be an active moderator.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `class` | `ref` → `app.tempomusic.staff.defs#takedownClass` | Yes |  |
| `reason` | `string` | Yes | Free-text reason recorded in the audit log. Mandatory. |
| `subject` | `union` | 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 | When true, all reports against this subject still in `open` or `underReview` are marked `actioned` in the same transaction; each closed report gets a `reportClosedByCascade` audit row linked to the takedown's audit id. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `auditEntryId` | `integer` | Yes |  |
| `moderationStatus` | `integer` | Yes | Final moderation_status value on the subject row. 1 = reported, 2 = tagged, 3 = legalHold. |
| `attachedReportsClosed` | `integer` | Yes | Number of attached reports auto-closed in this transaction. Zero when closeAttachedReports=false, or when there were no open/under-review reports to close. |

#### Errors

- **Forbidden**: Caller is not an active moderator.
- **InvalidRequest**: Malformed request: missing required field, or invalid takedown class.
- **SubjectNotFound**: The subject does not resolve to any row in the AppView projection.

## Raw Schema

```json
{
  "id": "app.tempomusic.staff.takedownSubject",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "subject",
            "class",
            "reason"
          ],
          "properties": {
            "class": {
              "ref": "app.tempomusic.staff.defs#takedownClass",
              "type": "ref"
            },
            "reason": {
              "type": "string",
              "maxLength": 1000,
              "description": "Free-text reason recorded in the audit log. Mandatory."
            },
            "subject": {
              "refs": [
                "app.tempomusic.moderation.defs#postSubject",
                "app.tempomusic.moderation.defs#replySubject",
                "app.tempomusic.moderation.defs#accountSubject"
              ],
              "type": "union"
            },
            "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": true,
              "description": "When true, all reports against this subject still in `open` or `underReview` are marked `actioned` in the same transaction; each closed report gets a `reportClosedByCascade` audit row linked to the takedown's audit id."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "Forbidden",
          "description": "Caller is not an active moderator."
        },
        {
          "name": "InvalidRequest",
          "description": "Malformed request: missing required field, or invalid takedown class."
        },
        {
          "name": "SubjectNotFound",
          "description": "The subject does not resolve to any row in the AppView projection."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "moderationStatus",
            "attachedReportsClosed",
            "auditEntryId"
          ],
          "properties": {
            "auditEntryId": {
              "type": "integer",
              "minimum": 1
            },
            "moderationStatus": {
              "type": "integer",
              "minimum": 1,
              "description": "Final moderation_status value on the subject row. 1 = reported, 2 = tagged, 3 = legalHold."
            },
            "attachedReportsClosed": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of attached reports auto-closed in this transaction. Zero when closeAttachedReports=false, or when there were no open/under-review reports to close."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Flip `moderation_status` on a subject row to a non-zero takedown class. Read paths immediately refuse to serve the subject (404 on getPost / getReply / actor reads). Re-takedown against an already-taken-down subject is permitted as a severity escalation (e.g. `reported` → `legalHold`) or to amend the reason; each call writes a new audit row. Scoped to the subject row ONLY: an account takedown flips the profile row (offensive avatar/bio case) and does not touch the account's content — hiding everything an account produced is the job of suspendAccount/banAccount, which are enforced at read time, trivially reversible and cover content posted while sanctioned. Requires the caller to be an active moderator."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
