# net.nusno.gyoka.feed.prunePostsBefore

> Remove posts indexed before an exclusive timestamp boundary.

- Kind: procedure
- Authority: feed.gyoka.nusno.net
- Lexicon: 1
- Published by [nusno.net](https://lexicon.garden/identity/did:plc:gjkxkrudpqumaiiytxodmpaj), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.feed.prunePostsBefore)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.feed.prunePostsBefore/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.feed.prunePostsBefore/analytics)

## Procedure (`net.nusno.gyoka.feed.prunePostsBefore`)

Type: procedure · POST

### Input (application/json)

- `before` (string · datetime, required)
- `feed` (string · at-uri, required)

### Output (application/json)

- `before` (string · datetime, required)
- `deletedCount` (integer, required)
  - Constraints: minimum: 0
- `feed` (string · at-uri, required)
- `orderRevision` (integer, required): Current feed order revision after pruning.
  - Constraints: minimum: 0

### Errors

- `AuthenticationRequired`: Returned when service authentication is required and the caller is not authenticated.
- `Forbidden`: Returned when the authenticated caller is not in the admin allowlist.
- `BadRequest`: Returned when request input is invalid.
- `UnknownFeed`: Returned when the target feed URI is not registered.
- `InternalServerError`: Returned when posts cannot be pruned.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Remove posts indexed before an exclusive timestamp boundary.",
      "errors": [
        {
          "description": "Returned when service authentication is required and the caller is not authenticated.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "Returned when the authenticated caller is not in the admin allowlist.",
          "name": "Forbidden"
        },
        {
          "description": "Returned when request input is invalid.",
          "name": "BadRequest"
        },
        {
          "description": "Returned when the target feed URI is not registered.",
          "name": "UnknownFeed"
        },
        {
          "description": "Returned when posts cannot be pruned.",
          "name": "InternalServerError"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "before": {
              "format": "datetime",
              "type": "string"
            },
            "feed": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "feed",
            "before"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "before": {
              "format": "datetime",
              "type": "string"
            },
            "deletedCount": {
              "minimum": 0,
              "type": "integer"
            },
            "feed": {
              "format": "at-uri",
              "type": "string"
            },
            "orderRevision": {
              "description": "Current feed order revision after pruning.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "feed",
            "before",
            "deletedCount",
            "orderRevision"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "net.nusno.gyoka.feed.prunePostsBefore",
  "lexicon": 1
}
```
