# chat.yakka.resolveChannel

> Published by [yakka.chat](https://lexicon.garden/identity/did:plc:wpjoy2orkqq5m65vq7gg7liz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.resolveChannel)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.resolveChannel/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.resolveChannel/examples)

## Definitions

### `chat.yakka.resolveChannel`

**Type**: `query`

Resolve a URL's channel segment, which may be a name or a TID. Called by the client's route guard before anything renders.

The five outcomes are distinct on purpose. Collapsing them would either lie about deleted channels or hide gated ones, and both are facts a reader is entitled to. `forbidden` deliberately reveals that a channel exists — which is safe only because channels are whole spaces and the credential mint has already made the same disclosure (ADR 0007).

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ref` | `string` | Yes | A channel name or a channel TID. |
| `server` | `string` (did) | Yes | The server's DID. |

#### Output

**Encoding**: `application/json`

### `chat.yakka.resolveChannel#output`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `kind` | `string` | Yes | `renamed` means the ref matched by TID rather than by name — the caller should redirect to the name it now has. |
| `name` | `string` | No | The name a `gone` channel had, so a tombstone can say what it was. |
| `channel` | `ref` → `chat.yakka.defs#channelView` | No |  |

## Raw Schema

```json
{
  "id": "chat.yakka.resolveChannel",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "ref": "#output",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "server",
          "ref"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "description": "A channel name or a channel TID."
          },
          "server": {
            "type": "string",
            "format": "did",
            "description": "The server's DID."
          }
        }
      },
      "description": "Resolve a URL's channel segment, which may be a name or a TID. Called by the client's route guard before anything renders.\n\nThe five outcomes are distinct on purpose. Collapsing them would either lie about deleted channels or hide gated ones, and both are facts a reader is entitled to. `forbidden` deliberately reveals that a channel exists — which is safe only because channels are whole spaces and the credential mint has already made the same disclosure (ADR 0007)."
    },
    "output": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "description": "`renamed` means the ref matched by TID rather than by name — the caller should redirect to the name it now has.",
          "knownValues": [
            "ok",
            "renamed",
            "forbidden",
            "gone",
            "notFound"
          ]
        },
        "name": {
          "type": "string",
          "description": "The name a `gone` channel had, so a tombstone can say what it was."
        },
        "channel": {
          "ref": "chat.yakka.defs#channelView",
          "type": "ref"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
