# tools.ozone.report.createActivity

> 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.report.createActivity)
- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.report.createActivity/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.report.createActivity/examples)

## Definitions

### `tools.ozone.report.createActivity`

**Type**: `procedure`

Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `activity` | `union` | Yes | The type of activity to record. |
| `eventId` | `integer` | No | ID of the report moderation event. Resolves to the report created from that event. Exactly one of reportId or eventId must be provided. |
| `internalNote` | `string` | No | Optional moderator-only note. Not visible to reporters. |
| `isAutomated` | `boolean` | No | Set true when this activity is triggered by an automated process. Defaults to false. |
| `publicNote` | `string` | No | Optional public-facing note, potentially visible to the reporter. |
| `reportId` | `integer` | No | ID of the report to record activity on. Exactly one of reportId or eventId must be provided. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `activity` | `ref` → `tools.ozone.report.defs#reportActivityView` | Yes |  |

#### Errors

- **ReportNotFound**: No report exists with the given reportId or eventId
- **InvalidStateTransition**: The requested state transition is not permitted from the report's current status
- **AlreadyInTargetState**: The report is already in the status implied by this activity type

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically.",
      "errors": [
        {
          "description": "No report exists with the given reportId or eventId",
          "name": "ReportNotFound"
        },
        {
          "description": "The requested state transition is not permitted from the report's current status",
          "name": "InvalidStateTransition"
        },
        {
          "description": "The report is already in the status implied by this activity type",
          "name": "AlreadyInTargetState"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "activity": {
              "description": "The type of activity to record.",
              "refs": [
                "tools.ozone.report.defs#queueActivity",
                "tools.ozone.report.defs#assignmentActivity",
                "tools.ozone.report.defs#escalationActivity",
                "tools.ozone.report.defs#closeActivity",
                "tools.ozone.report.defs#reopenActivity",
                "tools.ozone.report.defs#noteActivity"
              ],
              "type": "union"
            },
            "eventId": {
              "description": "ID of the report moderation event. Resolves to the report created from that event. Exactly one of reportId or eventId must be provided.",
              "type": "integer"
            },
            "internalNote": {
              "description": "Optional moderator-only note. Not visible to reporters.",
              "type": "string"
            },
            "isAutomated": {
              "default": false,
              "description": "Set true when this activity is triggered by an automated process. Defaults to false.",
              "type": "boolean"
            },
            "publicNote": {
              "description": "Optional public-facing note, potentially visible to the reporter.",
              "type": "string"
            },
            "reportId": {
              "description": "ID of the report to record activity on. Exactly one of reportId or eventId must be provided.",
              "type": "integer"
            }
          },
          "required": [
            "activity"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "activity": {
              "ref": "tools.ozone.report.defs#reportActivityView",
              "type": "ref"
            }
          },
          "required": [
            "activity"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "tools.ozone.report.createActivity",
  "lexicon": 1
}
```
