# chat.yakka.toggleReaction

> 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.toggleReaction)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.toggleReaction/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.toggleReaction/examples)

## Definitions

### `chat.yakka.toggleReaction`

**Type**: `procedure`

Add or remove the viewer's reaction to a message. A reaction is a record in the viewer's own repo, so this creates or deletes one — there is no shared counter to increment, and the count a client renders is the appview's tally of records it has ingested.

#### Input

**Encoding**: `application/json`

#### Output

**Encoding**: `application/json`

#### Errors

- **MessageNotFound**
- **ChannelForbidden**

### `chat.yakka.toggleReaction#input`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `emoji` | `string` | Yes |  |

### `chat.yakka.toggleReaction#output`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `mine` | `boolean` | Yes | Whether the viewer now reacts with this emoji — the state after the toggle, so a client need not guess which way it went. |

## Raw Schema

```json
{
  "id": "chat.yakka.toggleReaction",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "ref": "#input",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "MessageNotFound"
        },
        {
          "name": "ChannelForbidden"
        }
      ],
      "output": {
        "schema": {
          "ref": "#output",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Add or remove the viewer's reaction to a message. A reaction is a record in the viewer's own repo, so this creates or deletes one — there is no shared counter to increment, and the count a client renders is the appview's tally of records it has ingested."
    },
    "input": {
      "type": "object",
      "required": [
        "uri",
        "emoji"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "emoji": {
          "type": "string",
          "maxGraphemes": 8
        }
      }
    },
    "output": {
      "type": "object",
      "required": [
        "mine"
      ],
      "properties": {
        "mine": {
          "type": "boolean",
          "description": "Whether the viewer now reacts with this emoji — the state after the toggle, so a client need not guess which way it went."
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
