# tools.ozone.safelink.defs

> Published by [ozone-lexicons.bsky.social](https://lexicon.garden/identity/did:plc:33dt5kftu3jq2h5h4jjlqezt)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.defs/examples)

## Definitions

### `tools.ozone.safelink.defs#event`

**Type**: `object`

An event for URL safety decisions

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `integer` | Yes | Auto-incrementing row ID |
| `url` | `string` | Yes | The URL that this rule applies to |
| `action` | `ref` → `#actionType` | Yes |  |
| `reason` | `ref` → `#reasonType` | Yes |  |
| `comment` | `string` | No | Optional comment about the decision |
| `pattern` | `ref` → `#patternType` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `createdBy` | `string` (did) | Yes | DID of the user who created this rule |
| `eventType` | `ref` → `#eventType` | Yes |  |

### `tools.ozone.safelink.defs#urlRule`

**Type**: `object`

Input for creating a URL safety rule

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `url` | `string` | Yes | The URL or domain to apply the rule to |
| `action` | `ref` → `#actionType` | Yes |  |
| `reason` | `ref` → `#reasonType` | Yes |  |
| `comment` | `string` | No | Optional comment about the decision |
| `pattern` | `ref` → `#patternType` | Yes |  |
| `createdAt` | `string` (datetime) | Yes | Timestamp when the rule was created |
| `createdBy` | `string` (did) | Yes | DID of the user added the rule. |
| `updatedAt` | `string` (datetime) | Yes | Timestamp when the rule was last updated |

### `tools.ozone.safelink.defs#eventType`

**Type**: `string`

**Known Values**:
- `addRule`
- `updateRule`
- `removeRule`

### `tools.ozone.safelink.defs#actionType`

**Type**: `string`

**Known Values**:
- `block`
- `warn`
- `whitelist`

### `tools.ozone.safelink.defs#reasonType`

**Type**: `string`

**Known Values**:
- `csam`
- `spam`
- `phishing`
- `none`

### `tools.ozone.safelink.defs#patternType`

**Type**: `string`

**Known Values**:
- `domain`
- `url`

## Raw Schema

```json
{
  "id": "tools.ozone.safelink.defs",
  "defs": {
    "event": {
      "type": "object",
      "required": [
        "id",
        "eventType",
        "url",
        "pattern",
        "action",
        "reason",
        "createdBy",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Auto-incrementing row ID"
        },
        "url": {
          "type": "string",
          "description": "The URL that this rule applies to"
        },
        "action": {
          "ref": "#actionType",
          "type": "ref"
        },
        "reason": {
          "ref": "#reasonType",
          "type": "ref"
        },
        "comment": {
          "type": "string",
          "description": "Optional comment about the decision"
        },
        "pattern": {
          "ref": "#patternType",
          "type": "ref"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        },
        "createdBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the user who created this rule"
        },
        "eventType": {
          "ref": "#eventType",
          "type": "ref"
        }
      },
      "description": "An event for URL safety decisions"
    },
    "urlRule": {
      "type": "object",
      "required": [
        "url",
        "pattern",
        "action",
        "reason",
        "createdBy",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "The URL or domain to apply the rule to"
        },
        "action": {
          "ref": "#actionType",
          "type": "ref"
        },
        "reason": {
          "ref": "#reasonType",
          "type": "ref"
        },
        "comment": {
          "type": "string",
          "description": "Optional comment about the decision"
        },
        "pattern": {
          "ref": "#patternType",
          "type": "ref"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime",
          "description": "Timestamp when the rule was created"
        },
        "createdBy": {
          "type": "string",
          "format": "did",
          "description": "DID of the user added the rule."
        },
        "updatedAt": {
          "type": "string",
          "format": "datetime",
          "description": "Timestamp when the rule was last updated"
        }
      },
      "description": "Input for creating a URL safety rule"
    },
    "eventType": {
      "type": "string",
      "knownValues": [
        "addRule",
        "updateRule",
        "removeRule"
      ]
    },
    "actionType": {
      "type": "string",
      "knownValues": [
        "block",
        "warn",
        "whitelist"
      ]
    },
    "reasonType": {
      "type": "string",
      "knownValues": [
        "csam",
        "spam",
        "phishing",
        "none"
      ]
    },
    "patternType": {
      "type": "string",
      "knownValues": [
        "domain",
        "url"
      ]
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
