# org.atgrp.mod.querySubjectHistory

> Get a subject's moderation history. Requires auth as the group.

- Kind: query
- Authority: mod.atgrp.org
- Lexicon: 1
- Published by [lex.atgrp.org](https://lexicon.garden/identity/did:plc:4pt2cnpyvfgn5b7uxwn2shwv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.mod.querySubjectHistory)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.mod.querySubjectHistory/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.mod.querySubjectHistory/analytics)

## Query (`org.atgrp.mod.querySubjectHistory`)

Type: query · GET

### Parameters (query string)

- `cid` (string · cid): If set, only this version of the record.
- `cursor` (string)
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 100, default: 50
- `sort` (string)
  - Constraints: default: "newest", knownValues: newest | oldest
- `subject` (string · uri, required): An account DID or record URI.

### Output (application/json)

- `cursor` (string)
- `events` (array, required)
  - `items` (ref)
    - Reference: `org.atgrp.mod.defs#eventView`

### Errors

- `InvalidSubject`: The subject isn't in this group.
- `InvalidCursor`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Get a subject's moderation history. Requires auth as the group.",
      "errors": [
        {
          "description": "The subject isn't in this group.",
          "name": "InvalidSubject"
        },
        {
          "name": "InvalidCursor"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "type": "string"
            },
            "events": {
              "items": {
                "ref": "org.atgrp.mod.defs#eventView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "events"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cid": {
            "description": "If set, only this version of the record.",
            "format": "cid",
            "type": "string"
          },
          "cursor": {
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "sort": {
            "default": "newest",
            "knownValues": [
              "newest",
              "oldest"
            ],
            "type": "string"
          },
          "subject": {
            "description": "An account DID or record URI.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "subject"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "org.atgrp.mod.querySubjectHistory",
  "lexicon": 1
}
```
