# tools.ozone.safelink.queryRules

> 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.queryRules)
- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.queryRules/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.safelink.queryRules/examples)

## Definitions

### `tools.ozone.safelink.queryRules`

**Type**: `procedure`

Query URL safety rules

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `urls` | `array` | No | Filter by specific URLs or domains |
| `limit` | `integer` | No | Maximum number of results to return |
| `cursor` | `string` | No | Cursor for pagination |
| `reason` | `string` | No | Filter by reason type |
| `actions` | `array` | No | Filter by action types |
| `createdBy` | `string` (did) | No | Filter by rule creator |
| `patternType` | `string` | No | Filter by pattern type |
| `sortDirection` | `string` | No | Sort direction |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rules` | `array` | Yes |  |
| `cursor` | `string` | No | Next cursor for pagination. Only present if there are more results. |

## Raw Schema

```json
{
  "id": "tools.ozone.safelink.queryRules",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "properties": {
            "urls": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by specific URLs or domains"
            },
            "limit": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum number of results to return"
            },
            "cursor": {
              "type": "string",
              "description": "Cursor for pagination"
            },
            "reason": {
              "type": "string",
              "description": "Filter by reason type"
            },
            "actions": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by action types"
            },
            "createdBy": {
              "type": "string",
              "format": "did",
              "description": "Filter by rule creator"
            },
            "patternType": {
              "type": "string",
              "description": "Filter by pattern type"
            },
            "sortDirection": {
              "type": "string",
              "default": "desc",
              "description": "Sort direction",
              "knownValues": [
                "asc",
                "desc"
              ]
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "rules"
          ],
          "properties": {
            "rules": {
              "type": "array",
              "items": {
                "ref": "tools.ozone.safelink.defs#urlRule",
                "type": "ref"
              }
            },
            "cursor": {
              "type": "string",
              "description": "Next cursor for pagination. Only present if there are more results."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Query URL safety rules"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
