# dev.knotless.createReport

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

Reports an account, a repository, or what someone wrote about one, to the moderation service, as the account logged in to this appview's pages.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createReport)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createReport/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createReport/examples)

## Definitions

### `dev.knotless.createReport`

**Type**: `procedure`

Sends com.atproto.moderation.createReport to the moderation service this appview names, with a service token from the account logged in to its web pages, as `knotless report` does. Requires the session cookie the pages' login sets.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `reason` | `string` | Yes | Why, as com.atproto.moderation.defs names reasons, by the last word of each. |
| `subject` | `string` | Yes | What is reported: an account's handle or DID, a repository's knotless:// URL, or the at:// URI of a record, such as a pull, an issue or a comment. |
| `text` | `string` | No | More on why, for the moderators. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `reportId` | `integer` | Yes | The report's number, as the moderation service gave it. |

#### Errors

- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Sends com.atproto.moderation.createReport to the moderation service this appview names, with a service token from the account logged in to its web pages, as `knotless report` does. Requires the session cookie the pages' login sets.",
      "errors": [
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "reason": {
              "description": "Why, as com.atproto.moderation.defs names reasons, by the last word of each.",
              "knownValues": [
                "spam",
                "violation",
                "misleading",
                "sexual",
                "rude",
                "other"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "subject": {
              "description": "What is reported: an account's handle or DID, a repository's knotless:// URL, or the at:// URI of a record, such as a pull, an issue or a comment.",
              "maxLength": 8192,
              "type": "string"
            },
            "text": {
              "description": "More on why, for the moderators.",
              "maxGraphemes": 2000,
              "maxLength": 20000,
              "type": "string"
            }
          },
          "required": [
            "subject",
            "reason"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "reportId": {
              "description": "The report's number, as the moderation service gave it.",
              "type": "integer"
            }
          },
          "required": [
            "reportId"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Reports an account, a repository, or what someone wrote about one, to the moderation service, as the account logged in to this appview's pages.",
  "id": "dev.knotless.createReport",
  "lexicon": 1
}
```
