# fyi.opensocial.applyLabel

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.applyLabel)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.applyLabel/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.applyLabel/examples)

## Definitions

### `fyi.opensocial.applyLabel`

**Type**: `procedure`

Write a label record into the subject's space. Requires label, or takedown for !hide and !takedown.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `group` | `string` (did) | Yes | The group DID. Every method is served by the group's host and authorized against that group's roles. |
| `rule` | `string` (at-uri) | No |  |
| `subject` | `union` | Yes |  |
| `val` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

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

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Write a label record into the subject's space. Requires label, or takedown for !hide and !takedown.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "group": {
              "description": "The group DID. Every method is served by the group's host and authorized against that group's roles.",
              "format": "did",
              "type": "string"
            },
            "rule": {
              "format": "at-uri",
              "type": "string"
            },
            "subject": {
              "refs": [
                "com.atproto.admin.defs#repoRef",
                "com.atproto.repo.strongRef"
              ],
              "type": "union"
            },
            "val": {
              "type": "string"
            }
          },
          "required": [
            "group",
            "subject",
            "val"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cid": {
              "format": "cid",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri",
            "cid"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.applyLabel",
  "lexicon": 1
}
```
