# social.colibri.beta.bridge.createThread

> 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.bridge.createThread)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.createThread/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.createThread/examples)

## Definitions

### `social.colibri.beta.bridge.createThread`

**Type**: `procedure`

Opens a thread beside a linked channel for someone on another service. The community writes the thread, attributed to that person.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `anchor` | `ref` → `social.colibri.beta.defs#recordRef` | No | The message in the channel the thread was opened from. Absent opens a thread from scratch. |
| `author` | `ref` → `social.colibri.beta.bridge.defs#remoteAuthor` | Yes | Who opened the thread. |
| `channel` | `string` (space-ref) | Yes | The linked channel to open the thread beside. |
| `community` | `string` (did) | Yes | The community the registration belongs to. |
| `createdAt` | `string` (datetime) | No | When the thread was opened on the other service. Defaults to now. |
| `name` | `string` | Yes | The thread's title. |
| `registration` | `string` (tid) | Yes | Record key of the registration. |
| `remoteThread` | `string` | No | The thread's id on the other service. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `thread` | `string` (space-ref) | Yes | The thread's space. |

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **CommunityNotFound**: No community exists at the given DID.
- **RegistrationNotFound**: The community has no bridge registration with that id.
- **Forbidden**: The caller is not the bridge this registration belongs to.
- **RegistrationDisabled**: An admin has paused this registration.
- **ChannelNotLinked**: The channel is not linked to this registration.
- **RateLimited**: The bridge sent too many requests. Retry after the interval in the response headers.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.
- **MessageNotFound**: The anchor message does not exist in the given channel.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Opens a thread beside a linked channel for someone on another service. The community writes the thread, attributed to that person.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "No community exists at the given DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "The community has no bridge registration with that id.",
          "name": "RegistrationNotFound"
        },
        {
          "description": "The caller is not the bridge this registration belongs to.",
          "name": "Forbidden"
        },
        {
          "description": "An admin has paused this registration.",
          "name": "RegistrationDisabled"
        },
        {
          "description": "The channel is not linked to this registration.",
          "name": "ChannelNotLinked"
        },
        {
          "description": "The bridge sent too many requests. Retry after the interval in the response headers.",
          "name": "RateLimited"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        },
        {
          "description": "The anchor message does not exist in the given channel.",
          "name": "MessageNotFound"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "anchor": {
              "description": "The message in the channel the thread was opened from. Absent opens a thread from scratch.",
              "ref": "social.colibri.beta.defs#recordRef",
              "type": "ref"
            },
            "author": {
              "description": "Who opened the thread.",
              "ref": "social.colibri.beta.bridge.defs#remoteAuthor",
              "type": "ref"
            },
            "channel": {
              "description": "The linked channel to open the thread beside.",
              "format": "space-ref",
              "type": "string"
            },
            "community": {
              "description": "The community the registration belongs to.",
              "format": "did",
              "type": "string"
            },
            "createdAt": {
              "description": "When the thread was opened on the other service. Defaults to now.",
              "format": "datetime",
              "type": "string"
            },
            "name": {
              "description": "The thread's title.",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "registration": {
              "description": "Record key of the registration.",
              "format": "tid",
              "type": "string"
            },
            "remoteThread": {
              "description": "The thread's id on the other service.",
              "maxLength": 256,
              "type": "string"
            }
          },
          "required": [
            "community",
            "registration",
            "channel",
            "name",
            "author"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "thread": {
              "description": "The thread's space.",
              "format": "space-ref",
              "type": "string"
            }
          },
          "required": [
            "thread"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.bridge.createThread",
  "lexicon": 1
}
```
