# Tap-token endpoints

> Create, read, update, and delete rules and open the SSE match stream with a tap token (fh_) — endpoint reference, parameters, and the tap's rate limits.

These endpoints manage a tap's **rules** and open its **stream**, and require a
[tap token](/get-started/authentication) (`fh_`). Base URL: `https://api.firehose.com`.

## Rules

```text
GET    /v1/rules        # list
POST   /v1/rules        # create
GET    /v1/rules/:id    # get
PUT    /v1/rules/:id    # update (partial)
DELETE /v1/rules/:id    # delete (204)
```

Create body:

```json
{ "value": "tesla OR \"electric vehicle\"", "tag": "ev", "nsfw": false, "quality": true }
```

See [Rules & query syntax](/stream/rules) for the full object and the query language for `value`.

## Stream

```text
GET /v1/stream?timeout=60&since=30m&limit=100
```

Opens a [Server-Sent Events](/stream/streaming) connection delivering pages matching the tap's
rules. Parameters: `timeout` (1–300s), `since` (e.g. `30m`, max 24h), `offset`, `limit` (1–10000).
Reconnect with the `Last-Event-ID` header to resume. See [Match payload](/stream/match-payload) for
the document fields.

## Rate limits

| Endpoint | Limit |
| --- | --- |
| `/v1/rules` | 60 requests / min per tap |
| `/v1/stream` | 30 connections / min per tap |

See [Errors & limits](/api-reference/errors-and-limits) for status codes.
