# fyi.opensocial.putRule

> 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.putRule)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.putRule/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.putRule/examples)

## Definitions

### `fyi.opensocial.putRule`

**Type**: `procedure`

Create or update a rule. Requires group.configure. Fields are inlined rather than referencing fyi.opensocial.rule, because a record def cannot be used as an input object — same fix as updateProfile.

#### 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. |
| `rkey` | `string` (record-key) | No |  |
| `text` | `string` | No |  |
| `title` | `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": "Create or update a rule. Requires group.configure. Fields are inlined rather than referencing fyi.opensocial.rule, because a record def cannot be used as an input object — same fix as updateProfile.",
      "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"
            },
            "rkey": {
              "format": "record-key",
              "type": "string"
            },
            "text": {
              "maxGraphemes": 2000,
              "maxLength": 20000,
              "type": "string"
            },
            "title": {
              "maxGraphemes": 100,
              "maxLength": 1000,
              "type": "string"
            }
          },
          "required": [
            "group",
            "title"
          ],
          "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.putRule",
  "lexicon": 1
}
```
