# fyi.opensocial.createReport

> Report an account or record in a group, opening or reopening it in the moderation queue. Uses service auth from the caller, who must be able to read the subject's space.

- Kind: procedure
- Authority: opensocial.fyi
- Lexicon: 1
- Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createReport)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createReport/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createReport/analytics)

## Procedure (`fyi.opensocial.createReport`)

Type: procedure · POST

### Input (application/json)

- `group` (string · did, required): The group DID.
- `reason` (string)
  - Constraints: maxLength: 20000, maxGraphemes: 2000
- `reasonType` (ref, required)
  - Reference: `com.atproto.moderation.defs#reasonType`
- `rule` (string · at-uri): A rule in the group's meta space.
- `subject` (union, required)
  - One of: `fyi.opensocial.defs#accountSubject`, `fyi.opensocial.defs#recordSubject`

### Output (application/json)

- `createdAt` (string · datetime, required)
- `id` (string, required)
  - Constraints: minLength: 1, maxLength: 512

### Errors

- `GroupNotFound`: The group isn't hosted here.
- `InvalidSubject`: The subject isn't an account or record in this group.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Report an account or record in a group, opening or reopening it in the moderation queue. Uses service auth from the caller, who must be able to read the subject's space.",
      "errors": [
        {
          "description": "The group isn't hosted here.",
          "name": "GroupNotFound"
        },
        {
          "description": "The subject isn't an account or record in this group.",
          "name": "InvalidSubject"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "group": {
              "description": "The group DID.",
              "format": "did",
              "type": "string"
            },
            "reason": {
              "maxGraphemes": 2000,
              "maxLength": 20000,
              "type": "string"
            },
            "reasonType": {
              "ref": "com.atproto.moderation.defs#reasonType",
              "type": "ref"
            },
            "rule": {
              "description": "A rule in the group's meta space.",
              "format": "at-uri",
              "type": "string"
            },
            "subject": {
              "refs": [
                "fyi.opensocial.defs#accountSubject",
                "fyi.opensocial.defs#recordSubject"
              ],
              "type": "union"
            }
          },
          "required": [
            "group",
            "subject",
            "reasonType"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "createdAt": {
              "format": "datetime",
              "type": "string"
            },
            "id": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "id",
            "createdAt"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.createReport",
  "lexicon": 1
}
```
