# tools.ozone.safelink.syncSource

> Replace stored rules for one source from a complete snapshot. Existing rules owned by another source remain unchanged.

- Kind: procedure
- Authority: safelink.ozone.tools
- Lexicon: 1
- Published by [ozone-lexicons.bsky.social](https://lexicon.garden/identity/did:plc:33dt5kftu3jq2h5h4jjlqezt), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.syncSource)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.syncSource/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.syncSource/analytics)

## Procedure (`tools.ozone.safelink.syncSource`)

Type: procedure · POST

### Input (application/json)

- `rules` (array, required)
  - `items` (ref)
    - Reference: `#sourceRule`
- `source` (string, required): Source whose rules are being synchronized
  - Constraints: maxLength: 128

### Output (application/json)

- `added` (integer, required)
- `events` (integer, required)
- `removed` (integer, required)
- `updated` (integer, required)

## #sourceRule (`tools.ozone.safelink.syncSource#sourceRule`)

Type: object

### Properties

- `action` (ref, required)
  - Reference: `tools.ozone.safelink.defs#actionType`
- `pattern` (ref, required)
  - Reference: `tools.ozone.safelink.defs#patternType`
- `reason` (ref, required)
  - Reference: `tools.ozone.safelink.defs#reasonType`
- `url` (string, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Replace stored rules for one source from a complete snapshot. Existing rules owned by another source remain unchanged.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "rules": {
              "items": {
                "ref": "#sourceRule",
                "type": "ref"
              },
              "type": "array"
            },
            "source": {
              "description": "Source whose rules are being synchronized",
              "maxLength": 128,
              "type": "string"
            }
          },
          "required": [
            "source",
            "rules"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "added": {
              "type": "integer"
            },
            "events": {
              "type": "integer"
            },
            "removed": {
              "type": "integer"
            },
            "updated": {
              "type": "integer"
            }
          },
          "required": [
            "added",
            "updated",
            "removed",
            "events"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "sourceRule": {
      "properties": {
        "action": {
          "ref": "tools.ozone.safelink.defs#actionType",
          "type": "ref"
        },
        "pattern": {
          "ref": "tools.ozone.safelink.defs#patternType",
          "type": "ref"
        },
        "reason": {
          "ref": "tools.ozone.safelink.defs#reasonType",
          "type": "ref"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "url",
        "pattern",
        "action",
        "reason"
      ],
      "type": "object"
    }
  },
  "id": "tools.ozone.safelink.syncSource",
  "lexicon": 1
}
```
