# so.sprk.feed.getPostThread

> Published by [sprk.so](https://lexicon.garden/identity/did:plc:cveom2iroj3mt747sd4qqnr2)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/so.sprk.feed.getPostThread)
- [Documentation](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/so.sprk.feed.getPostThread/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:cveom2iroj3mt747sd4qqnr2/so.sprk.feed.getPostThread/examples)

## Definitions

### `so.sprk.feed.getPostThread`

**Type**: `query`

Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `sort` | `string` | No | Sorting for the thread replies. |
| `depth` | `integer` | No | How many levels of reply depth should be included in response. |
| `limit` | `integer` | No |  |
| `anchor` | `string` (at-uri) | Yes | Reference (AT-URI) to anchor post record. |
| `cursor` | `string` | No |  |
| `parentHeight` | `integer` | No | How many levels of parent (and grandparent, etc) post to include. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No |  |
| `thread` | `array` | Yes | A flat list of thread items. The depth of each item is indicated by the depth property inside the item. |
| `threadgate` | `ref` → `so.sprk.feed.defs#threadgateView` | No |  |

#### Errors

- **NotFound**

### `so.sprk.feed.getPostThread#threadItem`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `depth` | `integer` | Yes | The nesting level of this item in the thread. Depth 0 means the anchor item. |
| `value` | `union` | Yes |  |

## Raw Schema

```json
{
  "id": "so.sprk.feed.getPostThread",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "thread"
          ],
          "properties": {
            "cursor": {
              "type": "string"
            },
            "thread": {
              "type": "array",
              "items": {
                "ref": "#threadItem",
                "type": "ref"
              },
              "description": "A flat list of thread items. The depth of each item is indicated by the depth property inside the item."
            },
            "threadgate": {
              "ref": "so.sprk.feed.defs#threadgateView",
              "type": "ref"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "anchor"
        ],
        "properties": {
          "sort": {
            "type": "string",
            "default": "oldest",
            "description": "Sorting for the thread replies.",
            "knownValues": [
              "newest",
              "oldest",
              "top"
            ]
          },
          "depth": {
            "type": "integer",
            "default": 6,
            "maximum": 1000,
            "minimum": 0,
            "description": "How many levels of reply depth should be included in response."
          },
          "limit": {
            "type": "integer",
            "default": 50,
            "maximum": 100,
            "minimum": 1
          },
          "anchor": {
            "type": "string",
            "format": "at-uri",
            "description": "Reference (AT-URI) to anchor post record."
          },
          "cursor": {
            "type": "string"
          },
          "parentHeight": {
            "type": "integer",
            "default": 80,
            "maximum": 1000,
            "minimum": 0,
            "description": "How many levels of parent (and grandparent, etc) post to include."
          }
        }
      },
      "description": "Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests."
    },
    "threadItem": {
      "type": "object",
      "required": [
        "uri",
        "depth",
        "value"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "depth": {
          "type": "integer",
          "description": "The nesting level of this item in the thread. Depth 0 means the anchor item."
        },
        "value": {
          "refs": [
            "so.sprk.feed.defs#threadViewPost",
            "so.sprk.feed.defs#notFoundPost",
            "so.sprk.feed.defs#blockedPost"
          ],
          "type": "union"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
