<!-- source: https://secondlayer.tools/docs/api-reference#list-events -->

## Decoded events by event_type

`GET /v1/index/events`

One `event_type` per request, oldest first unless `order=desc`. Which filters and `fields` apply depends on the type; anything a type does not accept is refused.

### Filters

| Name | Type | Description |
| --- | --- | --- |
| `event_type` | enum, required | The event type to read. Required, unless you pass `types` instead. Values: `ft_transfer`, `nft_transfer`, `stx_transfer`, `stx_mint`, `stx_burn`, `stx_lock`, `ft_mint`, `ft_burn`, `nft_mint`, `nft_burn`, `print`. |
| `types` | string | Alias for `event_type`, the Streams spelling. Takes one value; a comma-separated set is refused. Mutually exclusive with `event_type`. |
| `order` | enum | `asc` (default) reads oldest first. `desc` reads newest first: with no height range, page one is the newest rows of the last day. A `desc` page's `next_cursor` starts with `desc:` and pages older; a cursor resumes only under the order that issued it, and the other order is refused with 400. Values: `asc`, `desc`. |
| `contract_id` | string | Contract principal, or a comma-separated set of up to 20 (e.g. `SP1.sbtc-token,SP1.sbtc-registry`). Mutually exclusive with `trait`. |
| `trait` | enum | Only contracts that declare or implement this SIP standard, resolved as of the page's `to_height`. Mutually exclusive with `contract_id`. Values: `sip-009`, `sip-010`, `sip-013`. |
| `asset_identifier` | string | Asset identifier (`<contract>::<asset>`). ft and nft transfer, mint and burn types only. |
| `sender` | string | Sending principal. Types with a sender only; on `stx_lock` it is the locked address. |
| `recipient` | string | Receiving principal. Types with a recipient only. |
| `tx_context` | boolean | `true` adds the submitting transaction's `tx_sender`, `tx_type`, `tx_status`, `tx_contract_id` and `tx_function_name` to each row. |
| `wait` | integer | Seconds (max 25) to hold the response open when there's nothing new past your cursor/from_height, instead of answering immediately. Returns early the moment new data commits, or at the timeout — either way you get a normal response, just later. Omit for the old poll-and-retry behavior. |

### Range and paging

| Name | Type | Description |
| --- | --- | --- |
| `limit` | integer · 1 to 1000 | Page size; capped at 1000. |
| `cursor` | string | `<block_height>:<event_index>` from a previous page's `next_cursor`. Resumes after it. |
| `from_cursor` | string | Same as `cursor`. Mutually exclusive with it and with `from_height`. |
| `from_height` | integer | First block height to read. Mutually exclusive with a cursor. With neither, the read starts one day behind the tip. |
| `to_height` | integer | Last block height to read, inclusive. |
| `fields` | string | Comma-separated columns to return: the universal ones, the type's own columns, and the `tx_*` columns when `tx_context=true`. `cursor`, `block_height` and `event_type` always come back; an unknown name is refused. Leaving out `block_time` skips a join. |

### Returns

A cursor envelope; `events` holds `IndexEvent` objects.

### Responses

- `200` Cursor-paginated envelope
- `400` A parameter, filter, cursor or body field was refused; `code` says which
- `401` This bind requires the instance token, and it was missing or wrong
- `429` Rate limited; retry after `Retry-After` seconds

### Example

```bash
curl https://api.secondlayer.tools/v1/index/events \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "events": [
    {
      "cursor": "9048921:2",
      "block_height": 9048921,
      "block_time": "2026-09-23T15:09:05.000Z",
      "tx_id": "0x55249ff4ec221ff6852b7fa37cf3729c7c50bc63f0da760f96e6886e2e8a911e",
      "tx_index": 4,
      "event_index": 2,
      "event_type": "stx_transfer",
      "contract_id": null,
      "sender": "SPX4KR3G5Z1SZT4RVF4ATHV4ZP4KXPWSZ4424W6K",
      "recipient": "SP2Z2CBMGWB9MQZAF5Z8X56KS69XRV3SJF4WKJ7J9",
      "amount": "50",
      "memo": null
    }
  ],
  "next_cursor": "7960000:42",
  "tip": {
    "block_height": 9048690,
    "finalized_height": 9048457,
    "lag_seconds": 4,
    "source_block_height": 9048692
  },
  "reorgs": [
    {
      "id": "3f16c2c5-9551-4ae9-adb0-923668e5c65e",
      "detected_at": "2026-09-15T15:39:38.129Z",
      "fork_point_height": 8996511,
      "old_index_block_hash": "0x45ba0195071488eda13afa66d8ce8612558a739f781be5a032d96332797c4174",
      "new_index_block_hash": "0xa686ff58e7c5ccb26c850a7eaffa7e7274fcbc081c706344eb6f1e1446023df0",
      "orphaned_range": {
        "from": "8996511:0",
        "to": "8996512:2701"
      },
      "new_canonical_tip": "8996511:0"
    }
  ]
}
```
