# tools.ozone.moderation.scheduleAction

> Published by [ozone-lexicons.bsky.social](https://lexicon.garden/identity/did:plc:33dt5kftu3jq2h5h4jjlqezt)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.scheduleAction)
- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.scheduleAction/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.scheduleAction/examples)

## Definitions

### `tools.ozone.moderation.scheduleAction`

**Type**: `procedure`

Schedule a moderation action to be executed at a future time

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `action` | `union` | Yes |  |
| `modTool` | `ref` → `tools.ozone.moderation.defs#modTool` | No | This will be propagated to the moderation event when it is applied |
| `subjects` | `array` | Yes | Array of DID subjects to schedule the action for |
| `createdBy` | `string` (did) | Yes |  |
| `scheduling` | `ref` → `#schedulingConfig` | Yes |  |

#### Output

**Encoding**: `application/json`

### `tools.ozone.moderation.scheduleAction#takedown`

**Type**: `object`

Schedule a takedown action

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `comment` | `string` | No |  |
| `policies` | `array` | No | Names/Keywords of the policies that drove the decision. |
| `strikeCount` | `integer` | No | Number of strikes to assign to the user when takedown is applied. |
| `emailContent` | `string` | No | Email content to be sent to the user upon takedown. |
| `emailSubject` | `string` | No | Subject of the email to be sent to the user upon takedown. |
| `severityLevel` | `string` | No | Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). |
| `durationInHours` | `integer` | No | Indicates how long the takedown should be in effect before automatically expiring. |
| `strikeExpiresAt` | `string` (datetime) | No | When the strike should expire. If not provided, the strike never expires. |
| `acknowledgeAccountSubjects` | `boolean` | No | If true, all other reports on content authored by this account will be resolved (acknowledged). |

### `tools.ozone.moderation.scheduleAction#failedScheduling`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `string` | Yes |  |
| `subject` | `string` (did) | Yes |  |
| `errorCode` | `string` | No |  |

### `tools.ozone.moderation.scheduleAction#schedulingConfig`

**Type**: `object`

Configuration for when the action should be executed

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `executeAt` | `string` (datetime) | No | Exact time to execute the action |
| `executeAfter` | `string` (datetime) | No | Earliest time to execute the action (for randomized scheduling) |
| `executeUntil` | `string` (datetime) | No | Latest time to execute the action (for randomized scheduling) |

### `tools.ozone.moderation.scheduleAction#scheduledActionResults`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `failed` | `array` | Yes |  |
| `succeeded` | `array` | Yes |  |

## Raw Schema

```json
{
  "id": "tools.ozone.moderation.scheduleAction",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "action",
            "subjects",
            "createdBy",
            "scheduling"
          ],
          "properties": {
            "action": {
              "refs": [
                "#takedown"
              ],
              "type": "union"
            },
            "modTool": {
              "ref": "tools.ozone.moderation.defs#modTool",
              "type": "ref",
              "description": "This will be propagated to the moderation event when it is applied"
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "did"
              },
              "maxLength": 100,
              "description": "Array of DID subjects to schedule the action for"
            },
            "createdBy": {
              "type": "string",
              "format": "did"
            },
            "scheduling": {
              "ref": "#schedulingConfig",
              "type": "ref"
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "ref": "#scheduledActionResults",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Schedule a moderation action to be executed at a future time"
    },
    "takedown": {
      "type": "object",
      "properties": {
        "comment": {
          "type": "string"
        },
        "policies": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxLength": 5,
          "description": "Names/Keywords of the policies that drove the decision."
        },
        "strikeCount": {
          "type": "integer",
          "description": "Number of strikes to assign to the user when takedown is applied."
        },
        "emailContent": {
          "type": "string",
          "description": "Email content to be sent to the user upon takedown."
        },
        "emailSubject": {
          "type": "string",
          "description": "Subject of the email to be sent to the user upon takedown."
        },
        "severityLevel": {
          "type": "string",
          "description": "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)."
        },
        "durationInHours": {
          "type": "integer",
          "description": "Indicates how long the takedown should be in effect before automatically expiring."
        },
        "strikeExpiresAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the strike should expire. If not provided, the strike never expires."
        },
        "acknowledgeAccountSubjects": {
          "type": "boolean",
          "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)."
        }
      },
      "description": "Schedule a takedown action"
    },
    "failedScheduling": {
      "type": "object",
      "required": [
        "subject",
        "error"
      ],
      "properties": {
        "error": {
          "type": "string"
        },
        "subject": {
          "type": "string",
          "format": "did"
        },
        "errorCode": {
          "type": "string"
        }
      }
    },
    "schedulingConfig": {
      "type": "object",
      "properties": {
        "executeAt": {
          "type": "string",
          "format": "datetime",
          "description": "Exact time to execute the action"
        },
        "executeAfter": {
          "type": "string",
          "format": "datetime",
          "description": "Earliest time to execute the action (for randomized scheduling)"
        },
        "executeUntil": {
          "type": "string",
          "format": "datetime",
          "description": "Latest time to execute the action (for randomized scheduling)"
        }
      },
      "description": "Configuration for when the action should be executed"
    },
    "scheduledActionResults": {
      "type": "object",
      "required": [
        "succeeded",
        "failed"
      ],
      "properties": {
        "failed": {
          "type": "array",
          "items": {
            "ref": "#failedScheduling",
            "type": "ref"
          }
        },
        "succeeded": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "did"
          }
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
