# place.stream.server.defs

- Kind: defs
- Authority: server.stream.place
- Lexicon: 1
- Published by [stream.place](https://lexicon.garden/identity/did:plc:rbvrr34edl5ddpuwcubjiost), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.defs/analytics)

## #rewriteRule (`place.stream.server.defs#rewriteRule`)

Type: object

### Properties

- `from` (string, required): Text to search for and replace.
  - Constraints: minLength: 1, maxLength: 100
- `to` (string, required): Text to replace with.
  - Constraints: maxLength: 100

## #storage (`place.stream.server.defs#storage`)

Type: object

S3 storage configuration for backups.

### Properties

- `isActive` (boolean, required): Whether backup storage is currently active.
- `url` (string, required): S3 storage URL with masked secret key in format: s3+https://ACCESS_KEY:***@endpoint/bucket

## #webhook (`place.stream.server.defs#webhook`)

Type: object

A webhook configuration for receiving Streamplace events.

### Properties

- `active` (boolean, required): Whether this webhook is currently active.
- `createdAt` (string · datetime, required): When this webhook was created.
- `description` (string): A description of what this webhook is used for.
  - Constraints: maxLength: 500
- `errorCount` (integer): Number of consecutive errors for this webhook.
- `events` (array, required): The types of events this webhook should receive.
  - `items` (string)
    - Constraints: enum: chat | livestream | follow | mention | stream.received
- `id` (string, required): Unique identifier for this webhook.
- `lastTriggered` (string · datetime): When this webhook was last triggered.
- `muteWords` (array): Words to filter out from chat messages. Messages containing any of these words will not be forwarded.
  - `items` (string)
    - Constraints: maxLength: 100
- `name` (string): A user-friendly name for this webhook.
  - Constraints: maxLength: 100
- `prefix` (string): Text to prepend to webhook messages.
  - Constraints: maxLength: 100
- `rewrite` (array): Text replacement rules for webhook messages.
  - `items` (ref)
    - Reference: `#rewriteRule`
- `suffix` (string): Text to append to webhook messages.
  - Constraints: maxLength: 100
- `updatedAt` (string · datetime): When this webhook was last updated.
- `url` (string · uri, required): The webhook URL where events will be sent.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "rewriteRule": {
      "properties": {
        "from": {
          "description": "Text to search for and replace.",
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        },
        "to": {
          "description": "Text to replace with.",
          "maxLength": 100,
          "type": "string"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "type": "object"
    },
    "storage": {
      "description": "S3 storage configuration for backups.",
      "properties": {
        "isActive": {
          "description": "Whether backup storage is currently active.",
          "type": "boolean"
        },
        "url": {
          "description": "S3 storage URL with masked secret key in format: s3+https://ACCESS_KEY:***@endpoint/bucket",
          "type": "string"
        }
      },
      "required": [
        "url",
        "isActive"
      ],
      "type": "object"
    },
    "webhook": {
      "description": "A webhook configuration for receiving Streamplace events.",
      "properties": {
        "active": {
          "description": "Whether this webhook is currently active.",
          "type": "boolean"
        },
        "createdAt": {
          "description": "When this webhook was created.",
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "description": "A description of what this webhook is used for.",
          "maxLength": 500,
          "type": "string"
        },
        "errorCount": {
          "description": "Number of consecutive errors for this webhook.",
          "type": "integer"
        },
        "events": {
          "description": "The types of events this webhook should receive.",
          "items": {
            "enum": [
              "chat",
              "livestream",
              "follow",
              "mention",
              "stream.received"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "description": "Unique identifier for this webhook.",
          "type": "string"
        },
        "lastTriggered": {
          "description": "When this webhook was last triggered.",
          "format": "datetime",
          "type": "string"
        },
        "muteWords": {
          "description": "Words to filter out from chat messages. Messages containing any of these words will not be forwarded.",
          "items": {
            "maxLength": 100,
            "type": "string"
          },
          "type": "array"
        },
        "name": {
          "description": "A user-friendly name for this webhook.",
          "maxLength": 100,
          "type": "string"
        },
        "prefix": {
          "description": "Text to prepend to webhook messages.",
          "maxLength": 100,
          "type": "string"
        },
        "rewrite": {
          "description": "Text replacement rules for webhook messages.",
          "items": {
            "ref": "#rewriteRule",
            "type": "ref"
          },
          "type": "array"
        },
        "suffix": {
          "description": "Text to append to webhook messages.",
          "maxLength": 100,
          "type": "string"
        },
        "updatedAt": {
          "description": "When this webhook was last updated.",
          "format": "datetime",
          "type": "string"
        },
        "url": {
          "description": "The webhook URL where events will be sent.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "id",
        "url",
        "events",
        "active",
        "createdAt"
      ],
      "type": "object"
    }
  },
  "id": "place.stream.server.defs",
  "lexicon": 1
}
```
