# social.coves.community.comment.create

> Published by [coves.social](https://lexicon.garden/identity/did:web:coves.social)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.comment.create)
- [Documentation](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.comment.create/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.community.comment.create/examples)

## Definitions

### `social.coves.community.comment.create`

**Type**: `procedure`

Create a comment on a post or another comment. Comments support nested threading, rich text, embeds, and self-labeling.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `embed` | `union` | No | Embedded media or quoted posts |
| `langs` | `array` | No | Languages used in the comment content (ISO 639-1) |
| `reply` | `object` | Yes | References for maintaining thread structure. Root always points to the original post, parent points to the immediate parent (post or comment). |
| `facets` | `array` | No | Annotations for rich text (mentions, links, formatting, block structure) |
| `labels` | `ref` → `com.atproto.label.defs#selfLabels` | No | Self-applied content labels |
| `content` | `string` | Yes | Comment text content |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes | CID of the created comment record |
| `uri` | `string` (at-uri) | Yes | AT-URI of the created comment |

#### Errors

- **InvalidReply**: The reply reference is invalid, malformed, or refers to non-existent content
- **ContentTooLong**: Comment content exceeds maximum length constraints
- **ContentEmpty**: Comment content is empty or contains only whitespace
- **NotAuthorized**: User is not authorized to create comments on this content
- **InvalidFacets**: Rich text facets are malformed, exceed limits, or reference byte ranges outside the content

## Raw Schema

```json
{
  "id": "social.coves.community.comment.create",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "reply",
            "content"
          ],
          "properties": {
            "embed": {
              "refs": [
                "social.coves.embed.images",
                "social.coves.embed.post"
              ],
              "type": "union",
              "description": "Embedded media or quoted posts"
            },
            "langs": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "language"
              },
              "maxLength": 3,
              "description": "Languages used in the comment content (ISO 639-1)"
            },
            "reply": {
              "type": "object",
              "required": [
                "root",
                "parent"
              ],
              "properties": {
                "root": {
                  "ref": "com.atproto.repo.strongRef",
                  "type": "ref",
                  "description": "Strong reference to the original post that started the thread"
                },
                "parent": {
                  "ref": "com.atproto.repo.strongRef",
                  "type": "ref",
                  "description": "Strong reference to the immediate parent (post or comment) being replied to"
                }
              },
              "description": "References for maintaining thread structure. Root always points to the original post, parent points to the immediate parent (post or comment)."
            },
            "facets": {
              "type": "array",
              "items": {
                "ref": "social.coves.richtext.facet",
                "type": "ref"
              },
              "maxLength": 200,
              "description": "Annotations for rich text (mentions, links, formatting, block structure)"
            },
            "labels": {
              "ref": "com.atproto.label.defs#selfLabels",
              "type": "ref",
              "description": "Self-applied content labels"
            },
            "content": {
              "type": "string",
              "maxLength": 100000,
              "description": "Comment text content",
              "maxGraphemes": 10000
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "InvalidReply",
          "description": "The reply reference is invalid, malformed, or refers to non-existent content"
        },
        {
          "name": "ContentTooLong",
          "description": "Comment content exceeds maximum length constraints"
        },
        {
          "name": "ContentEmpty",
          "description": "Comment content is empty or contains only whitespace"
        },
        {
          "name": "NotAuthorized",
          "description": "User is not authorized to create comments on this content"
        },
        {
          "name": "InvalidFacets",
          "description": "Rich text facets are malformed, exceed limits, or reference byte ranges outside the content"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "cid"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid",
              "description": "CID of the created comment record"
            },
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the created comment"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Create a comment on a post or another comment. Comments support nested threading, rich text, embeds, and self-labeling."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
