# tools.ozone.moderation.emitEvents

> Take a moderation action on multiple subjects at once. Each subject is processed independently; failures are listed in failedEvents. Only the listed event types are supported.

- Kind: procedure
- Authority: moderation.ozone.tools
- Lexicon: 1
- Published by [ozone-lexicons.bsky.social](https://lexicon.garden/identity/did:plc:33dt5kftu3jq2h5h4jjlqezt), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.emitEvents)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.emitEvents/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.moderation.emitEvents/analytics)

## Procedure (`tools.ozone.moderation.emitEvents`)

Type: procedure · POST

### Input (application/json)

- `createdBy` (string · did, required)
- `event` (union, required)
  - One of: `tools.ozone.moderation.defs#modEventTakedown`, `tools.ozone.moderation.defs#modEventAcknowledge`, `tools.ozone.moderation.defs#modEventLabel`, `tools.ozone.moderation.defs#modEventReport`, `tools.ozone.moderation.defs#modEventReverseTakedown`, `tools.ozone.moderation.defs#modEventResolveAppeal`, `tools.ozone.moderation.defs#modEventEmail`, `tools.ozone.moderation.defs#modEventTag`, `tools.ozone.moderation.defs#revokeAccountCredentialsEvent`
- `modTool` (ref)
  - Reference: `tools.ozone.moderation.defs#modTool`
- `subjects` (array, required): Array of subjects to apply the moderation event to.
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#subjectEntry`

### Output (application/json)

- `events` (array, required): Successfully processed moderation events.
  - `items` (ref)
    - Reference: `tools.ozone.moderation.defs#modEventView`
- `failedEvents` (array, required): Events that failed to process.
  - `items` (ref)
    - Reference: `#failedEvent`

### Errors

- `InvalidLabel`: One or more labels contain invalid characters.
- `DuplicateSubjects`: The subjects array contains duplicate entries.
- `EmptySubjects`: The subjects array is empty.
- `UnsupportedEvent`: The event type is not supported by this bulk endpoint.

## #failedEvent (`tools.ozone.moderation.emitEvents#failedEvent`)

Type: object

An event that failed to process.

### Properties

- `error` (string, required): Error message describing the reason for failure.
- `errorName` (string): Typed error identifier for programmatic handling. Omitted when the error is unexpected/uncategorized.
  - Constraints: knownValues: InvalidSubject | SubjectHasAction | AlreadyTakendown | NotTakendown | DuplicateExternalId | InvalidConfiguration | InvalidRequest
- `subject` (union, required): The subject from the failed event input.
  - One of: `com.atproto.admin.defs#repoRef`, `com.atproto.repo.strongRef`

## #subjectEntry (`tools.ozone.moderation.emitEvents#subjectEntry`)

Type: object

A subject with optional blob CIDs, external event ID, and report-level targeting. Report targeting applies only to this entry.

### Properties

- `externalId` (string): Deduplicate events of this type for this subject using an external ID.
- `reportAction` (ref): Optional report-level targeting for this subject. Links the event to matching reports and may notify reporters.
  - Reference: `tools.ozone.moderation.emitEvent#reportAction`
- `subject` (union, required)
  - One of: `com.atproto.admin.defs#repoRef`, `com.atproto.repo.strongRef`
- `subjectBlobCids` (array)
  - `items` (string · cid)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "failedEvent": {
      "description": "An event that failed to process.",
      "properties": {
        "error": {
          "description": "Error message describing the reason for failure.",
          "type": "string"
        },
        "errorName": {
          "description": "Typed error identifier for programmatic handling. Omitted when the error is unexpected/uncategorized.",
          "knownValues": [
            "InvalidSubject",
            "SubjectHasAction",
            "AlreadyTakendown",
            "NotTakendown",
            "DuplicateExternalId",
            "InvalidConfiguration",
            "InvalidRequest"
          ],
          "type": "string"
        },
        "subject": {
          "description": "The subject from the failed event input.",
          "refs": [
            "com.atproto.admin.defs#repoRef",
            "com.atproto.repo.strongRef"
          ],
          "type": "union"
        }
      },
      "required": [
        "error",
        "subject"
      ],
      "type": "object"
    },
    "main": {
      "description": "Take a moderation action on multiple subjects at once. Each subject is processed independently; failures are listed in failedEvents. Only the listed event types are supported.",
      "errors": [
        {
          "description": "One or more labels contain invalid characters.",
          "name": "InvalidLabel"
        },
        {
          "description": "The subjects array contains duplicate entries.",
          "name": "DuplicateSubjects"
        },
        {
          "description": "The subjects array is empty.",
          "name": "EmptySubjects"
        },
        {
          "description": "The event type is not supported by this bulk endpoint.",
          "name": "UnsupportedEvent"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "createdBy": {
              "format": "did",
              "type": "string"
            },
            "event": {
              "refs": [
                "tools.ozone.moderation.defs#modEventTakedown",
                "tools.ozone.moderation.defs#modEventAcknowledge",
                "tools.ozone.moderation.defs#modEventLabel",
                "tools.ozone.moderation.defs#modEventReport",
                "tools.ozone.moderation.defs#modEventReverseTakedown",
                "tools.ozone.moderation.defs#modEventResolveAppeal",
                "tools.ozone.moderation.defs#modEventEmail",
                "tools.ozone.moderation.defs#modEventTag",
                "tools.ozone.moderation.defs#revokeAccountCredentialsEvent"
              ],
              "type": "union"
            },
            "modTool": {
              "ref": "tools.ozone.moderation.defs#modTool",
              "type": "ref"
            },
            "subjects": {
              "description": "Array of subjects to apply the moderation event to.",
              "items": {
                "ref": "#subjectEntry",
                "type": "ref"
              },
              "maxLength": 100,
              "type": "array"
            }
          },
          "required": [
            "event",
            "subjects",
            "createdBy"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "events": {
              "description": "Successfully processed moderation events.",
              "items": {
                "ref": "tools.ozone.moderation.defs#modEventView",
                "type": "ref"
              },
              "type": "array"
            },
            "failedEvents": {
              "description": "Events that failed to process.",
              "items": {
                "ref": "#failedEvent",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "events",
            "failedEvents"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "subjectEntry": {
      "description": "A subject with optional blob CIDs, external event ID, and report-level targeting. Report targeting applies only to this entry.",
      "properties": {
        "externalId": {
          "description": "Deduplicate events of this type for this subject using an external ID.",
          "type": "string"
        },
        "reportAction": {
          "description": "Optional report-level targeting for this subject. Links the event to matching reports and may notify reporters.",
          "ref": "tools.ozone.moderation.emitEvent#reportAction",
          "type": "ref"
        },
        "subject": {
          "refs": [
            "com.atproto.admin.defs#repoRef",
            "com.atproto.repo.strongRef"
          ],
          "type": "union"
        },
        "subjectBlobCids": {
          "items": {
            "format": "cid",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "subject"
      ],
      "type": "object"
    }
  },
  "id": "tools.ozone.moderation.emitEvents",
  "lexicon": 1
}
```
