# net.nusno.gyoka.feed.movePosts

> Move existing posts to an explicit position in a feed.

- 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.movePosts)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.feed.movePosts/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.feed.movePosts/analytics)

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

Type: procedure · POST

### Input (application/json)

- `expectedRevision` (integer, required)
  - Constraints: minimum: 0
- `feed` (string · at-uri, required)
- `placement` (ref, required)
  - Reference: `net.nusno.gyoka.feed.defs#placement`
- `posts` (array, required)
  - Constraints: minLength: 1, maxLength: 25
  - `items` (string · at-uri)

### Output (application/json)

- `feed` (string · at-uri, required)
- `movedCount` (integer, required)
  - Constraints: minimum: 1
- `orderRevision` (integer, required)
  - 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 structure, placement, or move targets are invalid.
- `UnknownFeed`: Returned when the target feed URI is not registered.
- `RevisionConflict`: Returned when expectedRevision does not match the current order revision.
- `OrderRankSpaceExhausted`: Returned when no rank can be generated within the maximum rank length.
- `OrderConflict`: Returned when a rank conflict remains after retrying.
- `InternalServerError`: Returned when posts cannot be moved.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Move existing posts to an explicit position in a feed.",
      "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 structure, placement, or move targets are invalid.",
          "name": "BadRequest"
        },
        {
          "description": "Returned when the target feed URI is not registered.",
          "name": "UnknownFeed"
        },
        {
          "description": "Returned when expectedRevision does not match the current order revision.",
          "name": "RevisionConflict"
        },
        {
          "description": "Returned when no rank can be generated within the maximum rank length.",
          "name": "OrderRankSpaceExhausted"
        },
        {
          "description": "Returned when a rank conflict remains after retrying.",
          "name": "OrderConflict"
        },
        {
          "description": "Returned when posts cannot be moved.",
          "name": "InternalServerError"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "expectedRevision": {
              "minimum": 0,
              "type": "integer"
            },
            "feed": {
              "format": "at-uri",
              "type": "string"
            },
            "placement": {
              "ref": "net.nusno.gyoka.feed.defs#placement",
              "type": "ref"
            },
            "posts": {
              "items": {
                "format": "at-uri",
                "type": "string"
              },
              "maxLength": 25,
              "minLength": 1,
              "type": "array"
            }
          },
          "required": [
            "feed",
            "posts",
            "placement",
            "expectedRevision"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "feed": {
              "format": "at-uri",
              "type": "string"
            },
            "movedCount": {
              "minimum": 1,
              "type": "integer"
            },
            "orderRevision": {
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "feed",
            "orderRevision",
            "movedCount"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "net.nusno.gyoka.feed.movePosts",
  "lexicon": 1
}
```
