# social.colibri.beta.thread.moveMessages

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.thread.moveMessages)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.thread.moveMessages/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.thread.moveMessages/examples)

## Definitions

### `social.colibri.beta.thread.moveMessages`

**Type**: `procedure`

Moves messages into another thread or channel. A message lives in its author's own repo and cannot be rewritten by a moderator, so the move is a `moved` label written into the source space for each message. The destination serves each moved message at its own record key, so a selection keeps the order it was written in and reads among the destination's own messages by send time. The AppView withholds a moved message from the space it came from.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `destination` | `string` (space-ref) | Yes | The space to move them to, either a channel or a thread in the same community. |
| `reason` | `string` | No | Human-readable reason, recorded on every label in the batch. |
| `source` | `string` (space-ref) | Yes | The space the messages are in now, either a channel or a thread. |
| `subjects` | `array` | Yes | The messages to move, at most fifty in one call. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `batch` | `string` (tid) | Yes | The batch key shared by every label this call wrote, which groups the move for auditing. |
| `count` | `integer` | Yes | How many messages were moved. |

#### Errors

- **AuthRequired**: The request has no valid service auth.
- **Forbidden**: The requesting user lacks the thread.move permission, or may not read the source or post in the destination.
- **SpaceNotFound**: No space exists at the source or destination reference.
- **MessageNotFound**: One of the subjects is not a message in the source space.
- **InvalidRequest**: The destination is the source, belongs to another community, or a subject is not a message.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Moves messages into another thread or channel. A message lives in its author's own repo and cannot be rewritten by a moderator, so the move is a `moved` label written into the source space for each message. The destination serves each moved message at its own record key, so a selection keeps the order it was written in and reads among the destination's own messages by send time. The AppView withholds a moved message from the space it came from.",
      "errors": [
        {
          "description": "The request has no valid service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The requesting user lacks the thread.move permission, or may not read the source or post in the destination.",
          "name": "Forbidden"
        },
        {
          "description": "No space exists at the source or destination reference.",
          "name": "SpaceNotFound"
        },
        {
          "description": "One of the subjects is not a message in the source space.",
          "name": "MessageNotFound"
        },
        {
          "description": "The destination is the source, belongs to another community, or a subject is not a message.",
          "name": "InvalidRequest"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "destination": {
              "description": "The space to move them to, either a channel or a thread in the same community.",
              "format": "space-ref",
              "type": "string"
            },
            "reason": {
              "description": "Human-readable reason, recorded on every label in the batch.",
              "maxLength": 512,
              "type": "string"
            },
            "source": {
              "description": "The space the messages are in now, either a channel or a thread.",
              "format": "space-ref",
              "type": "string"
            },
            "subjects": {
              "description": "The messages to move, at most fifty in one call.",
              "items": {
                "description": "A message to move.",
                "ref": "social.colibri.beta.label#subject",
                "type": "ref"
              },
              "maxLength": 50,
              "minLength": 1,
              "type": "array"
            }
          },
          "required": [
            "source",
            "destination",
            "subjects"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "batch": {
              "description": "The batch key shared by every label this call wrote, which groups the move for auditing.",
              "format": "tid",
              "type": "string"
            },
            "count": {
              "description": "How many messages were moved.",
              "type": "integer"
            }
          },
          "required": [
            "batch",
            "count"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.thread.moveMessages",
  "lexicon": 1
}
```
